Skip to content

Fix ConfigMap name clash if env_file name is equal#2001

Merged
cdrage merged 3 commits intokubernetes:mainfrom
robertaistleitner:2000-env-file-name-collisions
Apr 15, 2025
Merged

Fix ConfigMap name clash if env_file name is equal#2001
cdrage merged 3 commits intokubernetes:mainfrom
robertaistleitner:2000-env-file-name-collisions

Conversation

@robertaistleitner
Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

Fixes naming collisions if env files have same filename in different folders.

Which issue(s) this PR fixes:

Fixes #2000

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 17, 2025
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Mar 17, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 17, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @robertaistleitner!

It looks like this is your first PR to kubernetes/kompose 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kompose has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot requested review from TessaIO and cdrage March 17, 2025 12:45
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 17, 2025
@robertaistleitner robertaistleitner force-pushed the 2000-env-file-name-collisions branch from 809e822 to 4ac66f1 Compare March 17, 2025 12:55
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 17, 2025
@robertaistleitner
Copy link
Copy Markdown
Contributor Author

There is probably one more issue I just found: ordering of the environment variables is also incorrect (in docker compose the order of env_files describe the priority of env vars to be applied, which is also the case for Kubernetes as far as I know).

@cdrage
Copy link
Copy Markdown
Member

cdrage commented Mar 17, 2025

There is probably one more issue I just found: ordering of the environment variables is also incorrect (in docker compose the order of env_files describe the priority of env vars to be applied, which is also the case for Kubernetes as far as I know).

Please open an issue :)

You are right, it's not 1-1 with the spec and it should order it correctly in case one of the env var's overrides another.

Either way, thanks for the contribution and once the tests pass, this already LGTM to me.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 17, 2025
@robertaistleitner
Copy link
Copy Markdown
Contributor Author

@cdrage since this fix also corresponds to the issue in #1999 and the ordering issue, I added it here as well.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 17, 2025
Copy link
Copy Markdown
Member

@cdrage cdrage left a comment

Choose a reason for hiding this comment

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

Sorry for the delay! Just catching up to kompose.

This LGTM, thanks for the awesome contribution! The code is great, there are tests added, and I can confirm on my end it works well with Kubernetes.

/lgtm
/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cdrage, robertaistleitner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 15, 2025
@cdrage cdrage merged commit 1b29e03 into kubernetes:main Apr 15, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ConfigMap name clash if env_file name is equal

3 participants