-
Notifications
You must be signed in to change notification settings - Fork 748
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
Make all the aws vpc cni environmental variables case insensitive #2334
Conversation
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.
This helps environment variables read in cmd/aws-vpc-cni/main.go
, but we need to be more thorough and do case-insensitive compare everywhere a boolean environment variable is accessed.
Also, this same function is in cmd/aws-vpc-cni-init/main.go
You'll need to go through each "Boolean as a String" environment variable in https://github.com/aws/amazon-vpc-cni-k8s#cni-configuration-variables and ensure that everywhere it is read in the code does a case-insensitive compare.
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.
Just a few more nits and then this should be good to go. @jerryhe1999 can you also rebase and squash this into one commit?
made environmental flags managed by aws-vpc-cni-init/main.go case insensitive refactor getEnv function in cmd/aws-vpc-cni and cmd/aws-vpc-cni-init fixed logic issue and added unit tests for utils package fixed import function name with Capital initial log the error message instead of return it removed unnecessary log
2ac819f
to
89ac30d
Compare
What type of PR is this?
feature
Which issue does this PR fix:
#2311
What does this PR do / Why do we need it:
Originally, we have several aws-vpc-cni environmental variables with the type Boolean as a String which against good coding standards. Having case insensitive values for Boolean can avoid users meet situation that spend 2+ weeks to figure out the case sensitivity cause the problem.
Testing done on this change:
Manually tested the code change in testing cluster with setting environmental variables in case insensitivity. Both unit tests and integration tests passed
Automation added to e2e:
N/A
Will this PR introduce any new dependencies?:
No
Will this break upgrades or downgrades. Has updating a running cluster been tested?:
No
Does this change require updates to the CNI daemonset config files to work?:
No
Does this PR introduce any user-facing change?:
No
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.