-
Notifications
You must be signed in to change notification settings - Fork 65
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
reqs: handle the absence of disable_snapshot_annotations #284
reqs: handle the absence of disable_snapshot_annotations #284
Conversation
I'm marking this as do-not-merge because I still need to handle the uninstall case, i.e., we need to somehow mark that the line was added then remove it. I was thinking in literally put a comment on the line just above the
Then on uninstall it will know the line should be removed. Yes, ugly hack... any other ideas? |
@fitzthum @fidencio @stevenhorsman it would be nice to have your review and hear ideas for the uninstall problem. |
I agree that's it's not great, but I can't think of anything better and I've definitely written worse hacks! |
With the generated comment, it will append the property like this:
On uninstall, delete both lines resulting in
Here is the diff:
|
@mkulke you can test this PR (including the logic to uninstall nydus) with That image was built as:
|
else | ||
# In case the property does not exist, let's append it to the | ||
# [plugins."io.containerd.grpc.v1.cri".containerd] section. | ||
sed -i '/\[plugins\..*\.containerd\]/adisable_snapshot_annotations = false' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a typo? adisable_snapshot_annotations
vs. disable_snapshot_annotations
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@portersrc the next char after '/' can be a command to sed. In this case, '/a' tells to Append the following string (i.e disable_snapshot_annotations) ;)
Thanks for the careful review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw: if we want to keep the indent this should work w/ nested capture groups:
sed -e 's|\(\(\s*\)\[plugins.\"io.containerd.grpc.v1.cri\".containerd\]\)|\1\n\2 ohai=true|' /etc/containerd/config.toml | grep -C1 ohai
[plugins."io.containerd.grpc.v1.cri".containerd]
ohai=true
default_runtime_name = "runc"
Thanks. I built reqs-payload images from your branch and used referenced them in the kustomize config for ccruntime/peer-pods. I can confirm it works, the line is being added to |
regarding the uninstall part, I think that's the best we can do. Reverting a configuration change is a brittle endeavour, we don't own the config, so a user/tool could do any sort of changes between a coco install and uninstall, which could mess with our undo logic. |
Great! Let me incorporate the uninstall logic on this PR then run the CI. |
Exactly. Let's see if for long term we find a solution that doesn't need to touch containerd's files. |
f28280a
to
6b53e78
Compare
Let the fun begin: /test |
The `disable_snapshot_annotations` should be set to `false` in the containerd's configuration.toml in order to make the remote snapshotter work. The reqs-deploy.sh currently handles only the case where the property is already present on the configuration file, i.e., it will switch from `true` to `false` only. However, on some nodes like in AWS EKS and Azure AKS, `disable_snapshot_annotations` simply doesn't exist so the current `sed` takes no effect (and the current containerd's behavior is to disable annotations). This changed the handler so that on the absence of `disable_snapshot_annotations`, it is appended to the `[plugins."io.containerd.grpc.v1.cri".containerd]` section. It will leave a comment just below the added line so that the uninstall handler know the line should be removed. Signed-off-by: Magnus Kulke <[email protected]> Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
a669c41
to
603a555
Compare
/test |
@wainersm, maybe you want to add a commit to bump the operator version to this PR to save us a step? sure! |
Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
@fitzthum added the commit to bump the release version |
let the fun begin (2): /test |
I guess we will need one more PR after this to update the reqs payload. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Maybe the version bump should actually have gone in the next PR, but not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
disable_snapshot_annotations
should be set tofalse
in the containerd's configuration.toml in order to make the remote snapshotter work. The reqs-deploy.sh currently handles only the case where the property is already present on the configuration file, i.e., it will switch fromtrue
tofalse
only. However, on some nodes like in AWS EKS and Azure AKS,disable_snapshot_annotations
simply doesn't exist so the currentsed
takes no effect (and the current containerd's behavior is to disable annotations).This changed the handler so that on the absence of
disable_snapshot_annotations
, it is appended to the[plugins."io.containerd.grpc.v1.cri".containerd]
section.Fix for issue 2 in kata-containers/kata-containers#8407