Skip to content
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

Feature/allow ipv6 disable annotation #647

Merged

Conversation

andrewmarklloyd
Copy link
Contributor

Issue #, if available:
Implements the feature described in #646

Description of changes:
Similar to how annotations on the pod are exposed to configure options on the proxyinit container, this feature adds an annotation to set APPMESH_ENABLE_IPV6=0 in the proxyinit container.

Adds tests to ensure the default APPMESH_ENABLE_IPV6=1 is set when the annotation is unset as well as tests APPMESH_ENABLE_IPV6=0 when the annotation is set to appmesh.k8s.aws/ipv6: disabled.

Additionally I ran make locally which made changes to apis/appmesh/v1beta2/zz_generated.deepcopy.go.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@bendu
Copy link
Contributor

bendu commented Oct 26, 2022

Hi Andrew. Thank you for your PR. We will review it as soon as possible.

@@ -56,18 +57,22 @@ type proxyConfig struct {
proxyIngressPort int64
// UID used by proxy
proxyUID int64
// todo
enableIPV6 *bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be a *bool? Why not just a bool?

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 found when using a bool instead of *bool, and enableIPV6 was not set explicitly in proxyConfig, that the default value was false. This resulted in unexpected value of APPMESH_ENABLE_IPV6: 0 in the proxyinit env vars.

This allows checking for m.proxyConfig.enableIPV6 != nil && !*m.proxyConfig.enableIPV6 ensuring that the default value of APPMESH_ENABLE_IPV6 remains 1.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah understood. Can you add a comment explaining this? I want to make sure the next person who looks at the code understands this is to set the default to 1 when the variable is unset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for configuring APPMESH_ENABLE_IPV6 env var in proxyinit container
3 participants