-
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
controller: Handle snapshotter per handler #303
controller: Handle snapshotter per handler #303
Conversation
b11460f
to
5f42870
Compare
/test |
5f42870
to
b78fbde
Compare
During testing of this I found a bug in kata-deploy, so waiting on kata-containers/kata-containers#8721 to be merged to fix this. |
5c2e16a
to
4ee7f81
Compare
I found a few more issues on the kata-deploy side, all addressed as part of: kata-containers/kata-containers#8733 I've also created a new PR on the Operator side in order to test with the kata-deploy payload, before this one / and the Kata Containers one gets merged: #310 |
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 now. Thanks!
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, thanks.
controllers/ccruntime_controller.go
Outdated
shim := strings.TrimPrefix(runtimeClass.Name, "kata-") | ||
if snapshotter_handler_mapping == "" { | ||
snapshotter_handler_mapping += shim + ":" + runtimeClass.Snapshotter | ||
} else { | ||
snapshotter_handler_mapping += "," + shim + ":" + runtimeClass.Snapshotter | ||
} |
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.
this kata-
prefix processing is repeated below. Can we do it only once? I also think preparing snapshotter_handler_mapping
can follow the same strings.Join()
approach used by runtimeClassNames
.
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.
So, the prefix processing is done for a different reason here, and looking at the code is quite hard to make this only once, as kata-containers explicitly requires the shim name for all the operations, and for the sake of the user's experience the operator requires a full runtime class name (as in kata-qemu).
About the string.Join(), this can be done, I just need to either make sure ,
is correctly treated on the kata-containers side, or that we remove the last ,
that would be added by the strings.Join().
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.
or that we remove the last
,
that would be added by the strings.Join().
The doc example suggests that it is not added: https://pkg.go.dev/strings#example-Join
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.
Cool, I've updated the PR and simplified a little bit the logic.
Thanks for the rveiew, @mythi!
4ee7f81
to
0ba092b
Compare
Let's start properly setting a specific snapshotter per runtime handler configured for containerd. This work depends on a work done on the Kata Containers side to better support setting snapshotters per runtime handler. The PR from the Kata Containers side is: kata-containers/kata-containers#8655. Signed-off-by: Fabiano Fidêncio <[email protected]>
0ba092b
to
a0400af
Compare
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
Let's start properly setting a specific snapshotter per runtime handler configured for containerd.
This work depends on a work done on the Kata Containers side to better support setting snapshotters per runtime handler.
The PR from the Kata Containers side is:
kata-containers/kata-containers#8655.