-
Notifications
You must be signed in to change notification settings - Fork 60
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
pre-install-payload: avoid using sed
to edit the containerd's configuration.toml
#304
Comments
An alternative is to re-write https://github.com/confidential-containers/operator/blob/main/install/pre-install-payload/scripts/reqs-deploy.sh in either Go or Rust which should have libs for editing toml files. |
My suggestion wouldn't be to rewrite So, specifically the logic in: |
I'm not against that, but we end up with yet another |
I don't think that would be case. the tools are largely ok, imo. the problem is how they are used. We could indeed, instead of using compiled code + a library, write a bash function invoking a cli tool comprehensively w/ tests, ci, fixtures, proper error handling, whatnot. In practice this is not a lot of fun to do in bash, so it's not done. |
note: there is I wrote a snippet that would illustrate how a dedicated tool for changing the containerd config could look like #313 if you look at the number of panics() and expects() it becomes obvious how many code paths there are for such a seemingly simple operation |
This is an idea that @stevenhorsman brought on our CI working group meeting today, inspired on recent changes of kata-deploy to adopt the
tomlq
tool (see kata-containers/kata-containers@dd9f5b0).In commit 603a555 we introduced a handler for the
disable_snapshot_annotations
in containerd's configuration.toml (see https://github.com/confidential-containers/operator/blob/main/install/pre-install-payload/scripts/reqs-deploy.sh#L188). This handler is fairly complex and error prone because it uses grep/sed commands. A better alternative would be use a specific tool for editing toml liketomlq
.If we adopt
tomlq
then it will be needed to get it installed in pre-install-payload image (https://github.com/confidential-containers/operator/blob/main/install/pre-install-payload/Dockerfile).Cc @fidencio @mkulke
The text was updated successfully, but these errors were encountered: