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
[virt-controller] Fix warning about ephemeral dir creation #10253
Conversation
@@ -587,9 +586,6 @@ func (vca *VirtControllerApp) initCommon() { | |||
golog.Fatal(err) | |||
} | |||
|
|||
if err := containerdisk.SetLocalDirectory(filepath.Join(vca.ephemeralDiskDir, "container-disk-data")); err != nil { |
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 am not sure I would miss this feature but right now removing this means you cannot specify a custom location and we change the default or don't we?
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.
oh right. good catch. Seems like I need to untangle the create and set operation.
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.
ah, indeed, now I also see that this is not only about creating the dir.
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 this directory needs to be in virt-launcher only, right?
kubevirt/cmd/virt-launcher/virt-launcher.go
Line 183 in cdbdf1d
err = containerdisk.SetLocalDirectory(containerDiskDir) |
There are formatting issues:
ERROR: git tree state is not clean!
You probably need to run 'make generate' or 'make' and commit the changes
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: pkg/virt-controller/watch/BUILD.bazel
Apart from that, the PR looks good.
/lgtm cancel |
/hold until I find time to refactor. |
The ephemeral directory for containerdisks needs to be known by virt-controller to create the right pod templates. By mistake the controller also tries to create the ephemeral directory. By accident virt-controller also tries to create this directory in its own image without actually using it. If that fails (e.g. permission issues since untested and no functional difference) we get a warning which can lead to confusions. Removing the code which tries for no reason to create the directory which look like this: ``` failed to create ephemeral disk dir: mkdir /var/run/kubevirt-ephemeral-disk ``` Signed-off-by: Roman Mohr <rmohr@google.com>
868374b
to
0f8920d
Compare
/unhold not proud of my solution, since it does not improve the package, but should work now without the side effect. |
/retest |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xpivarc 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 |
@rmohr: 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. |
What this PR does / why we need it:
The ephemeral directory for containerdisks needs to be known by virt-controller to create the right pod templates. By mistake the controller also tries to create the ephemeral directory.
By accident virt-controller also tries to create this directory in its own image without actually using it. If that fails (e.g. permission issues since untested and no functional difference) we get a warning which can lead to confusions.
Removing the code which tries for no reason to create the directory which look like this:
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: