Skip to content
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

Merged
merged 1 commit into from Sep 26, 2023

Conversation

rmohr
Copy link
Member

@rmohr rmohr commented Aug 7, 2023

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:

failed to create ephemeral disk dir: mkdir /var/run/kubevirt-ephemeral-disk

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:

Stop trying to create unused directory /var/run/kubevirt-ephemeral-disk in virt-controller

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Aug 7, 2023
@@ -587,9 +586,6 @@ func (vca *VirtControllerApp) initCommon() {
golog.Fatal(err)
}

if err := containerdisk.SetLocalDirectory(filepath.Join(vca.ephemeralDiskDir, "container-disk-data")); err != nil {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@vasiliy-ul vasiliy-ul left a 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?

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.

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2023
@vasiliy-ul
Copy link
Contributor

/lgtm cancel

@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2023
@rmohr
Copy link
Member Author

rmohr commented Aug 8, 2023

/hold

until I find time to refactor.

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 8, 2023
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>
@rmohr
Copy link
Member Author

rmohr commented Aug 16, 2023

/unhold

not proud of my solution, since it does not improve the package, but should work now without the side effect.

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 16, 2023
@xpivarc
Copy link
Member

xpivarc commented Sep 26, 2023

/retest

Copy link
Member

@xpivarc xpivarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 26, 2023
@kubevirt-bot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 26, 2023
@kubevirt-bot
Copy link
Contributor

@rmohr: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-e2e-k8s-1.25-sig-compute-migrations 868374b link true /test pull-kubevirt-e2e-k8s-1.25-sig-compute-migrations
pull-kubevirt-e2e-k8s-1.28-sig-operator 0f8920d link unknown /test pull-kubevirt-e2e-k8s-1.28-sig-operator

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.

@kubevirt-bot kubevirt-bot merged commit b32e562 into kubevirt:main Sep 26, 2023
40 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants