Pilot param clusterRegistriesNamespace should default to pilot namespace#6446
Pilot param clusterRegistriesNamespace should default to pilot namespace#6446rshriram merged 1 commit intoistio:masterfrom
Conversation
|
This helps with multicluster tests--see Issue #6072 |
pilot/pkg/bootstrap/server.go
Outdated
There was a problem hiding this comment.
hm, what if pilot runs out of cluster mode and namespace parameter is not specified?
There was a problem hiding this comment.
in that case args.Namespace will be the pilot pod's namespace (os.Getenv("POD_NAMESPACE")). See the code section right above this one.
There was a problem hiding this comment.
@tiswanso that was exactly why I asked, if pilot runs OUT of cluster then line 199 will return nil as this variable is not defined.
There was a problem hiding this comment.
@sbezverk -- sorry, I misunderstood. hmm... in that case perhaps we shouldn't start the secret controller since there's no args to direct us to watch something. OR alternatively, we could revert to istio-system if args.Namespace == nil.
There was a problem hiding this comment.
I think having a istio-system namespace as a last resort is fine.
- use pilot ns as first default and "istio-system" as last resort
b30e16b to
fc2657b
Compare
Codecov Report
@@ Coverage Diff @@
## master #6446 +/- ##
========================================
- Coverage 68% 67% -<1%
========================================
Files 368 345 -23
Lines 31687 30407 -1280
========================================
- Hits 21489 20317 -1172
+ Misses 9346 9280 -66
+ Partials 852 810 -42
Continue to review full report at Codecov.
|
| discoveryCmd.PersistentFlags().StringVar(&serverArgs.Config.ClusterRegistriesConfigmap, "clusterRegistriesConfigMap", "", | ||
| "ConfigMap map for clusters config store") | ||
| discoveryCmd.PersistentFlags().StringVar(&serverArgs.Config.ClusterRegistriesNamespace, "clusterRegistriesNamespace", "istio-system", | ||
| discoveryCmd.PersistentFlags().StringVar(&serverArgs.Config.ClusterRegistriesNamespace, "clusterRegistriesNamespace", "", |
There was a problem hiding this comment.
Why not define the default value as istio-system as before and set ClusterRegistriesNamespace to args.Namespace if ClusterRegistriesNamespace is empty?
There was a problem hiding this comment.
if the default is declared here as before, we can't tell if the user didn't set it.
|
@tiswanso: The following test failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/lgtm |
| discoveryCmd.PersistentFlags().StringVar(&serverArgs.Config.ClusterRegistriesConfigmap, "clusterRegistriesConfigMap", "", | ||
| "ConfigMap map for clusters config store") | ||
| discoveryCmd.PersistentFlags().StringVar(&serverArgs.Config.ClusterRegistriesNamespace, "clusterRegistriesNamespace", "istio-system", | ||
| discoveryCmd.PersistentFlags().StringVar(&serverArgs.Config.ClusterRegistriesNamespace, "clusterRegistriesNamespace", "", |
| if args.Config.ClusterRegistriesNamespace == "" { | ||
| if args.Namespace != "" { | ||
| args.Config.ClusterRegistriesNamespace = args.Namespace | ||
| } else { |
There was a problem hiding this comment.
One more question, I think we do not need the else now, as 198-199 can always guarantee there is a value for args.Namespace
There was a problem hiding this comment.
I was thinking the same but @sbezverk reminded that there's deployment scenarios with pilot not in a k8s cluster & so it's possible there's no POD_NAMESPACE in env.
There was a problem hiding this comment.
make sense, do you want to add a comment here to clarify?
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: baodongli, gyliu513, john-a-joyce, sbezverk, tiswanso Assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/assign @costinm |
* Revert "Remove v2 transition commands since everything is now v2 (#6665)" This reverts commit 6339eb6. * Revert "Pilot param clusterRegistriesNamespace should default to pilot namespace (#6446)" This reverts commit b9294f7. * Revert "iptable just "return" by uid as the parameter u indicates (#6561)" This reverts commit 22a0b88. * Revert "Remove node agent service, residue from flexvolume driver. (#6651)" This reverts commit db3da82. * Revert "Continuously reapply galley CA bundle to prevent overwrite (#6599)" This reverts commit f9e8fd8. * Revert "Do not count typeConfigs if it is error. (#6527)" This reverts commit eb1de31. * Revert "Make racetest green - Fixed data races and flakiness (#6625)" This reverts commit 30b8ecb. * Revert "Improve push squashing (#6641)" This reverts commit 399cd2d.
…ace (istio#6446) - use pilot ns as first default and "istio-system" as last resort
* Revert "Remove v2 transition commands since everything is now v2 (istio#6665)" This reverts commit 6339eb6. * Revert "Pilot param clusterRegistriesNamespace should default to pilot namespace (istio#6446)" This reverts commit b9294f7. * Revert "iptable just "return" by uid as the parameter u indicates (istio#6561)" This reverts commit 22a0b88. * Revert "Remove node agent service, residue from flexvolume driver. (istio#6651)" This reverts commit db3da82. * Revert "Continuously reapply galley CA bundle to prevent overwrite (istio#6599)" This reverts commit f9e8fd8. * Revert "Do not count typeConfigs if it is error. (istio#6527)" This reverts commit eb1de31. * Revert "Make racetest green - Fixed data races and flakiness (istio#6625)" This reverts commit 30b8ecb. * Revert "Improve push squashing (istio#6641)" This reverts commit 399cd2d.
Uh oh!
There was an error while loading. Please reload this page.