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

Implement SetLock for all virt providers #20322

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

jakecorrenti
Copy link
Member

Implements a shared SetLock function for all virtualization providers. Adds the function to the VM interface to require implementation.

[NO NEW TESTS NEEDED]

Does this PR introduce a user-facing change?

None

@jakecorrenti
Copy link
Member Author

Note: I do not have a way to test WSL or HyperV

@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@rhatdan
Copy link
Member

rhatdan commented Oct 10, 2023

LGTM

pkg/machine/config.go Outdated Show resolved Hide resolved
@jakecorrenti jakecorrenti force-pushed the set-lock branch 2 times, most recently from 74c935b to 1b04c74 Compare October 10, 2023 20:13
@packit-as-a-service
Copy link

Cockpit tests failed for commit 74c935bfa300c9800000afedd9f0a1ff50da4fb5. @martinpitt, @jelly, @mvollmer please check.

@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@packit-as-a-service
Copy link

Cockpit tests failed for commit b67eb2fd28af4cb47779492517b37160f8f99d72. @martinpitt, @jelly, @mvollmer please check.

@martinpitt
Copy link
Contributor

The cockpit-podman f39 failure is unrelated, please ignore (or retry). It's on my todo list (but annoyingly difficult)

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

One Q and nit, otherwise LGTM

If we'd make use of inheritance/specialization, we could still avoid more redundancy. As the "Provider" could then call whatever it's wrapped around and the locking could happen for instance once in (Provider) Set() once.

Doing that would require turning the "Provider" into a struct which in turn includes an interface.

But, let's go one step at a time.

pkg/machine/config.go Outdated Show resolved Hide resolved
@packit-as-a-service
Copy link

Cockpit tests failed for commit 0422569aea69f5e8924e01bb1f82586372d379e2. @martinpitt, @jelly, @mvollmer please check.

Implements a shared `GetLock` function for virtualization providers. Returns
a pointer to a lockfile used for serializing write operations.

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <[email protected]>
@packit-as-a-service
Copy link

Cockpit tests failed for commit fd437126b187c1a7debc366737af22bdb1714c1c. @martinpitt, @jelly, @mvollmer please check.

@packit-as-a-service
Copy link

Cockpit tests failed for commit 987dc2b. @martinpitt, @jelly, @mvollmer please check.

@TomSweeneyRedHat
Copy link
Member

LGTM

@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2023

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 12, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jakecorrenti, rhatdan

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 12, 2023
@openshift-ci openshift-ci bot merged commit 5afa949 into containers:main Oct 12, 2023
94 of 97 checks passed
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jan 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants