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
Move host-disk to handler #6240
Move host-disk to handler #6240
Conversation
This change is noop because func ReplacePVCByHostDisk is executed from handler context but the file path is relevant to launcher context. Therefore the change is failing 100% time and we are ignoring it. Also this is side-effect of the function. Signed-off-by: L. Pivarc <lpivarc@redhat.com>
We create disk only on one node. NFS server needs to be scheduled on this node. Signed-off-by: L. Pivarc <lpivarc@redhat.com>
Creating a disk in launcher requires the PVC to be correctly configurated. This will allow us to provide better user experience even with non-root launcher. Signed-off-by: L. Pivarc <lpivarc@redhat.com>
/cc @davidvossel |
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.
why is moving all of this host-disk logic to handler better than having virt-handler simply set permissions on disks before performing the sync with virt-launcher?
hostDiskCreator := hostdisk.NewHostDiskCreator(l.notifier, l.lessPVCSpaceToleration, l.minimumPVCReserveBytes) | ||
err = hostDiskCreator.Create(vmi) | ||
if err != nil { | ||
return domain, fmt.Errorf("preparing host-disks failed: %v", err) | ||
} |
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.
if lessPVCSpaceToleration and minimumPVCReserveBytes are only used here, then there's a whole chain of things starting with template.go that can be removed related to these vars.
We would need to set permissions for disk(if exists) and for empty pvc (directory) because disks are created inside sync and not before. For me, it feels like additional code. Moving host-disk to the handler is simpler and it also allows us to drop the dependency from the launcher. This is good as the launcher has fewer privileges now. |
ah okay, so we potentially have to deal with the case where a disk doesn't exist as well. I think this makes sense to move to handler then |
Signed-off-by: L. Pivarc <lpivarc@redhat.com>
ede47f0
to
a6de356
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidvossel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
2 similar comments
/retest |
/retest |
/retest |
1 similar comment
/retest |
/retest |
/retest |
1 similar comment
/retest |
/hold |
/hold cancel |
/retest |
/retest |
@xpivarc: The following test 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. |
/cherrypick release-0.44 |
@xpivarc: #6240 failed to apply on top of branch "release-0.44":
In response to this:
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. |
…ndler Move host-disk to handler (cherry picked from commit c5ded0d)
…ndler Move host-disk to handler (cherry picked from commit c5ded0d) Signed-off-by: L. Pivarc <lpivarc@redhat.com>
What this PR does / why we need it:
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:
Release note: