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
Enables using scripts to modify VMI definition #10479
Conversation
Hi @dharmit. Thanks for your PR. I'm waiting for a kubevirt member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
c48a58a
to
2a6d6f2
Compare
@victortoso since you have worked extensively on sidecar, can you please provide your feedback on this PR? Perhaps the README.md at |
Hi @dharmit, I'll be happy to but I can't Today. Tomorrow or the day after at latest ;) |
The job "pull-kubevirt-generate" fails with following log:
But we need the How do I ensure it's not a problem for EDIT: Fixed this in 89e2c20. |
Hi, I just started looking at this, sorry the delay.
Have you tried the I'll keep looking into the patch series to follow the ConfigMap introduction/usage |
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.
I like the idea. I consider myself new to kubevirt/k8s design so it would be great to have second opinion on using ConfigMap to store scripts and creating the volumes, etc.
I'd test with sidecar-shim container image and if possible use it here. There are a few reasons for this suggestion:
- Reduce boilerplate with gRPC
- We can add new APIs in the hooks, implement it on the sidecar-shim and should benefit this or other sidecars that use sidecar-shim. For example, this attempt to fix second migration on VMI with sidecar.
- It already does similar logic, like executing command on $PATH. The difference is that the command has to be the hook name.
ConfigMap: &k8sv1.ConfigMapVolumeSource{ | ||
LocalObjectReference: k8sv1.LocalObjectReference{Name: cm.Name}, | ||
DefaultMode: pointer.Int32(0777), | ||
}, |
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 is a very interesting approach. It means that with a single container-image we could deploy different scripts.
BUILD.bazel
Outdated
container_push( | ||
name = "push-example-hook-generic", | ||
format = "Docker", | ||
image = "//cmd/example-hook-generic:example-hook-generic-image", |
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.
I'd suggest moving it under the cmd/sidecars
folder. I'm on the process of doing that, just waiting it to be unhold, see: #10320
creates a new type ConfigMap in hooks.go and adds necessary logic in template.go to populate volume Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
c36e8af
to
8acea18
Compare
8acea18
to
8c5cc36
Compare
eed1566
to
86a47df
Compare
/lgtm |
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
86a47df
to
cb461a2
Compare
/lgtm |
@dharmit: The following tests failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Enables using scripts to modify VMI definition
What this PR does / why we need it:
Presently, users need to write a Go program if they want to use the hook sidecar functionality to modify VMI's XML definition before its creation. This PR aims to let the users write a shell/python script for the same.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note: