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

cni: use case-insensitive names for CNI chaining mode #28050

Conversation

asauber
Copy link
Member

@asauber asauber commented Sep 9, 2023

Allow case-insensitive names for CNI chaining mode

Upon startup, Cilium must write CNI config files for the configured chaining mode. For this purpose, it uses a package-scoped map with lowercase string keys to refer to each mode.

We have seen configurations in the wild which do not use all-lowercase names for these chaining modes. For example, in the reccomended configuration for OpenShift conformance testing we have:

cni.chainingMode=portMap

This causes Cilium to fail on startup with:

failed to render CNI configuration file: invalid CNI chaining mode:
portMap
Allow case-insensitive name for CNI chaining mode

Allow case-insensitive names for CNI chaining mode

Upon startup, Cilium must write CNI config files for the configured
chaining mode. For this purpose, it uses a package-scoped map with
lowercase string keys to refer to each mode.

We have seen configurations in the wild which do not use all-lowercase
names for these chaining modes. For example, in the reccomended
configuration for OpenShift conformance testing we have:

  cni.chainingMode=portMap

This causes Cilium to fail on startup with:

   failed to render CNI configuration file: invalid CNI chaining mode:
   portMap

Signed-off-by: Andrew Sauber <2046750+asauber@users.noreply.github.com>
@asauber asauber requested a review from a team as a code owner September 9, 2023 03:39
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 9, 2023
@asauber asauber added the release-note/minor This PR changes functionality that users may find relevant to operating Cilium. label Sep 9, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 9, 2023
Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

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

Not a CNI expert, but code change and explanation LGTM 👍

@asauber
Copy link
Member Author

asauber commented Sep 11, 2023

/test

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Sep 11, 2023
@ldelossa ldelossa merged commit 7d6a7d1 into cilium:main Sep 11, 2023
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants