Skip to content

Conversation

tiswanso
Copy link
Contributor

@tiswanso tiswanso commented Jun 20, 2018

  • use pilot ns if set
  • use "istio-system" as last resort

@tiswanso
Copy link
Contributor Author

This helps with multicluster tests--see Issue #6072

@tiswanso
Copy link
Contributor Author

/cc @baodongli @gyliu513 @sbezverk

@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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
@tiswanso tiswanso force-pushed the fix_clusreg_ns_default branch from b30e16b to fc2657b Compare June 21, 2018 14:38
@codecov
Copy link

codecov bot commented Jun 21, 2018

Codecov Report

Merging #6446 into master will decrease coverage by 1%.
The diff coverage is 100%.

Impacted file tree graph

@@           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
Impacted Files Coverage Δ
pilot/cmd/pilot-discovery/main.go 77% <100%> (ø)
istioctl/cmd/istioctl/authn.go 50% <0%> (-23%) ⬇️
...olarwinds/internal/papertrail/papertrail_logger.go 59% <0%> (-21%) ⬇️
istioctl/cmd/istioctl/inject.go 27% <0%> (-16%) ⬇️
pilot/pkg/proxy/envoy/v2/debug.go 27% <0%> (-2%) ⬇️
pilot/pkg/serviceregistry/consul/controller.go 71% <0%> (-2%) ⬇️
mixer/adapter/bypass/bypass.go 62% <0%> (-2%) ⬇️
pilot/pkg/networking/plugin/authz/rbac.go 79% <0%> (-1%) ⬇️
...t/pkg/serviceregistry/external/servicediscovery.go 80% <0%> (-1%) ⬇️
istioctl/cmd/istioctl/config.go 2% <0%> (-1%) ⬇️
... and 116 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b1c7bc...fc2657b. Read the comment docs.

@@ -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", "",
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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

@istio-testing
Copy link
Collaborator

istio-testing commented Jun 21, 2018

@tiswanso: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/e2e-dashboard.sh fc2657b link /test e2e-dashboard

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.

Copy link

@baodongli baodongli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@sbezverk
Copy link
Contributor

/lgtm

Copy link
Member

@gyliu513 gyliu513 left a 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", "",
Copy link
Member

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 {
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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?

@john-a-joyce
Copy link
Contributor

/lgtm

@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: baodongli, gyliu513, john-a-joyce, sbezverk, tiswanso
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: costinm

Assign the PR to them by writing /assign @costinm in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sdake
Copy link
Member

sdake commented Jun 24, 2018

/assign @costinm

@rshriram rshriram merged commit b9294f7 into istio:master Jun 27, 2018
hklai added a commit that referenced this pull request Jun 27, 2018
hklai added a commit that referenced this pull request Jun 27, 2018
* 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.
quanjielin pushed a commit to quanjielin/istio that referenced this pull request Jul 2, 2018
…ace (istio#6446)

- use pilot ns as first default and "istio-system" as last resort
quanjielin pushed a commit to quanjielin/istio that referenced this pull request Jul 2, 2018
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants