Skip to content

Commit

Permalink
Use consts
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip committed Jul 25, 2024
1 parent 5f9942d commit e75515c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/traffic/cmd/manager/managerutil/envconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type Env struct {
ClientDnsIncludeSuffixes []string `env:"CLIENT_DNS_INCLUDE_SUFFIXES, parser=split-trim, default="`
ClientConnectionTTL time.Duration `env:"CLIENT_CONNECTION_TTL, parser=time.ParseDuration"`

ArgoRolloutsEnabled bool `env:"ARGO_ROLLOUTS_ENABLED, parser=bool, default=0"`
ArgoRolloutsEnabled bool `env:"ARGO_ROLLOUTS_ENABLED, parser=bool, default=false"`
}

func (e *Env) GeneratorConfig(qualifiedAgentImage string) (agentmap.GeneratorConfig, error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/traffic/cmd/manager/managerutil/envconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestEnvconfig(t *testing.T) {
"simple": {
Input: map[string]string{
"AGENT_REGISTRY": "docker.io/datawire",
"ARGO_ROLLOUTS_ENABLED": "1",
"ARGO_ROLLOUTS_ENABLED": "true",
},
Output: func(e *managerutil.Env) {
e.AgentRegistry = "docker.io/datawire"
Expand Down
8 changes: 4 additions & 4 deletions pkg/client/userd/trafficmgr/workloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ func (nw *namespacedWASWatcher) cancel() {

func (nw *namespacedWASWatcher) hasSynced() bool {
return nw.svcWatcher.HasSynced() &&
nw.wlWatchers[0].HasSynced() &&
nw.wlWatchers[1].HasSynced() &&
nw.wlWatchers[2].HasSynced() &&
(nw.wlWatchers[3] == nil || nw.wlWatchers[3].HasSynced())
nw.wlWatchers[deployments].HasSynced() &&
nw.wlWatchers[replicasets].HasSynced() &&
nw.wlWatchers[statefulsets].HasSynced() &&
(nw.wlWatchers[rollouts] == nil || nw.wlWatchers[rollouts].HasSynced())
}

func newWASWatcher(knownWorkloadKinds *manager.KnownWorkloadKinds) *workloadsAndServicesWatcher {
Expand Down

0 comments on commit e75515c

Please sign in to comment.