Skip to content

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

Merged
mogren merged 5 commits intoaws:masterfrom
willejs:docker-config-file-fix
Jul 9, 2020
Merged

Use sed as a stream editor and redirect to file#1069
mogren merged 5 commits intoaws:masterfrom
willejs:docker-config-file-fix

Conversation

@willejs
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

willejs commented Jul 6, 2020

@jaypipes could you review this please?

@willejs
Copy link
Copy Markdown
Contributor Author

willejs commented Jul 8, 2020

@mogren can you check this out too please?

Copy link
Copy Markdown
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