Skip to content

Commit

Permalink
Issue 1714: max-workers reset to 1. (operator-framework#1838)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrodri authored Aug 20, 2019
1 parent e09b9b0 commit 640171c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/ansible/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"github.com/operator-framework/operator-sdk/pkg/metrics"
"github.com/operator-framework/operator-sdk/pkg/restmapper"
sdkVersion "github.com/operator-framework/operator-sdk/version"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -191,7 +191,7 @@ func getMaxWorkers(gvk schema.GroupVersionKind, defValue int) int {
))
switch maxWorkers, err := strconv.Atoi(os.Getenv(envVar)); {
case maxWorkers <= 1:
return 1
return defValue
case err != nil:
// we don't care why we couldn't parse it just use default
log.Info("Failed to parse %v from environment. Using default %v", envVar, defValue)
Expand Down
4 changes: 2 additions & 2 deletions pkg/ansible/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func TestMaxWorkers(t *testing.T) {
Version: "v1alpha1",
Kind: "MemCacheService",
},
defvalue: 1,
expected: 1,
defvalue: 10,
expected: 10,
setenvvar: false,
envvar: "WORKER_MEMCACHESERVICE_CACHE_EXAMPLE_COM",
},
Expand Down

0 comments on commit 640171c

Please sign in to comment.