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

Use sed as a stream editor and redirect to file #1069

Merged
merged 5 commits into from
Jul 9, 2020

Conversation

willejs
Copy link
Contributor

@willejs willejs commented Jul 2, 2020

Currently, you can't easily provide your own config file for the cni. Mounting a file from a configmap is readonly, and the magical find replace that sed does is inline against the existing file fails. Instead, I am proposing that we copy the file to a tempfile and modify that before we copy it to its destination.

I thought about perhaps having an environment variable for a custom template file, flag, or similar, but I think that actually that could cause more complexity in the entrypoint script, and I didn't want to change the behavior that much.

Sorry for the 'ergh' next to the sed comment, I wanted to show that I wasn't a fan of how this works, the sedding of config files 🤣. I appreciate why this is done here though.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@willejs
Copy link
Contributor Author

willejs commented Jul 6, 2020

@jaypipes could you review this please?

@willejs
Copy link
Contributor Author

willejs commented Jul 8, 2020

@mogren can you check this out too please?

scripts/entrypoint.sh Outdated Show resolved Hide resolved
scripts/entrypoint.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@mogren mogren left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@mogren mogren merged commit 7e9ea88 into aws:master Jul 9, 2020
@mogren mogren changed the title create a temporary config file to be manipulated by sed in dockerfile Use sed as a stream editor and redirect to file Jul 13, 2020
@mogren mogren mentioned this pull request Jul 13, 2020
@mogren mogren added this to the v1.7.0 milestone Jul 13, 2020
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.

3 participants