Skip to content

Commit

Permalink
Add watchedNamespaces for istioctl operator dump (istio#35453)
Browse files Browse the repository at this point in the history
* Add watchedNamespaces for istioctl operator dump

Signed-off-by: Arko Dasgupta <[email protected]>

* release note

Signed-off-by: Arko Dasgupta <[email protected]>
  • Loading branch information
arkodg authored Oct 6, 2021
1 parent 3ea4bdd commit 17085ed
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions operator/cmd/mesh/operator-dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func addOperatorDumpFlags(cmd *cobra.Command, args *operatorDumpArgs) {
cmd.PersistentFlags().StringVar(&args.common.hub, "hub", hub, HubFlagHelpStr)
cmd.PersistentFlags().StringVar(&args.common.tag, "tag", tag, TagFlagHelpStr)
cmd.PersistentFlags().StringSliceVar(&args.common.imagePullSecrets, "imagePullSecrets", nil, ImagePullSecretsHelpStr)
cmd.PersistentFlags().StringVar(&args.common.watchedNamespaces, "watchedNamespaces", istioDefaultNamespace,
"The namespaces the operator controller watches, could be namespace list separated by comma, eg. 'ns1,ns2'")
cmd.PersistentFlags().StringVar(&args.common.operatorNamespace, "operatorNamespace", operatorDefaultNamespace, OperatorNamespaceHelpstr)
cmd.PersistentFlags().StringVarP(&args.common.manifestsPath, "charts", "", "", ChartsDeprecatedStr)
cmd.PersistentFlags().StringVarP(&args.common.manifestsPath, "manifests", "d", "", ManifestsFlagHelpStr)
Expand Down
1 change: 1 addition & 0 deletions operator/cmd/mesh/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestOperatorDump(t *testing.T) {
cmd += " --tag " + odArgs.common.tag
cmd += " --imagePullSecrets " + strings.Join(odArgs.common.imagePullSecrets, ",")
cmd += " --operatorNamespace " + odArgs.common.operatorNamespace
cmd += " --watchedNamespaces " + odArgs.common.watchedNamespaces
cmd += " --manifests=" + string(snapshotCharts)

gotYAML, err := runCommand(cmd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ spec:
memory: 128Mi
env:
- name: WATCH_NAMESPACE
value:
value: "istio-test-namespace1,istio-test-namespace2"
- name: LEADER_ELECTION_NAMESPACE
value: "operator-test-namespace"
- name: POD_NAME
Expand Down
9 changes: 9 additions & 0 deletions releasenotes/notes/35485.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: release-notes/v2
kind: feature
area: istioctl
issue:
- 35485

releaseNotes:
- |
**Added** `istioctl operator dump` now supports the `watchedNamespaces` argument to specify the namespaces the operator controller watches.

0 comments on commit 17085ed

Please sign in to comment.