-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Pilot param clusterRegistriesNamespace should default to pilot namespace #6446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This helps with multicluster tests--see Issue #6072 |
pilot/pkg/bootstrap/server.go
Outdated
@@ -198,6 +198,9 @@ func NewServer(args PilotArgs) (*Server, error) { | |||
if args.Namespace == "" { | |||
args.Namespace = os.Getenv("POD_NAMESPACE") | |||
} | |||
if args.Config.ClusterRegistriesNamespace == "" { | |||
args.Config.ClusterRegistriesNamespace = args.Namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, what if pilot runs out of cluster mode and namespace parameter is not specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
@@ -95,7 +95,7 @@ func init() { | |||
"Cloud Foundry config file") | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the default is declared here as before, we can't tell if the user didn't set it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, thanks @tiswanso
@tiswanso: The following test failed, say
Instructions 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@@ -95,7 +95,7 @@ func init() { | |||
"Cloud Foundry config file") | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, thanks @tiswanso
if args.Config.ClusterRegistriesNamespace == "" { | ||
if args.Namespace != "" { | ||
args.Config.ClusterRegistriesNamespace = args.Namespace | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Needs 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.