-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support to set a specify hostName for a CloneVM #10834
base: main
Are you sure you want to change the base?
Conversation
Hi @matthewei. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I forget to add e2e test and unit-test. I will add it soon. |
776e88c
to
d00e7bc
Compare
/cc for api change review |
@alaypatel07: GitHub didn't allow me to request PR reviews from the following users: change, review, for. Note that only kubevirt members and repo collaborators can review this PR, and authors cannot review their own PRs. 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. |
/cc @alaypatel07 |
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.
In terms of API, the changes look good, added couple of nits. Pending tests, this would be a good add to vmclone, thanks @matthewei
pkg/virt-api/webhooks/validating-webhook/admitters/vmclone-admitter.go
Outdated
Show resolved
Hide resolved
d00e7bc
to
d296f54
Compare
543a3a7
to
157119d
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.
Plese help me to review this PR
pkg/virt-api/webhooks/validating-webhook/admitters/vmclone-admitter.go
Outdated
Show resolved
Hide resolved
pkg/virt-api/webhooks/validating-webhook/admitters/validate-k8s-utils.go
Outdated
Show resolved
Hide resolved
pkg/virt-api/webhooks/validating-webhook/admitters/validate-k8s-utils.go
Outdated
Show resolved
Hide resolved
pkg/virt-api/webhooks/validating-webhook/admitters/vmclone-admitter.go
Outdated
Show resolved
Hide resolved
d6d0604
to
323d2ad
Compare
@fossedihelm Hi, please help me review this PR. Many thanks! |
/retest |
@matthewei: Cannot trigger testing until a trusted user reviews the PR and leaves an 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. |
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.
Thanks a lot @matthewei!
Almost there! :) left some small comments.
Great job and thanks for your patience!
@@ -65,7 +65,9 @@ type VirtualMachineCloneSpec struct { | |||
// inspecting status "TargetName" field below. | |||
// +optional | |||
Target *corev1.TypedLocalObjectReference `json:"target,omitempty"` | |||
|
|||
// Specifies the hostname of the clone vmi. |
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.
// Specifies the hostname of the clone vmi. | |
// Specifies the hostname of the clone vm. |
Small but important correction: clones operate on the VM level, not the VMI level
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.
done
@@ -108,6 +110,10 @@ func (admitter *VirtualMachineCloneAdmitter) Admit(ar *admissionv1.AdmissionRevi | |||
causes = append(causes, newCauses...) | |||
} | |||
|
|||
if newCauses := validateCloneHostNameNotConformingToDNSLabelRules(vmClone); newCauses != 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.
In the future we may add more general validations to hostname
if newCauses := validateCloneHostNameNotConformingToDNSLabelRules(vmClone); newCauses != nil { | |
if newCauses := validateCloneHostName(vmClone); newCauses != 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.
done
323d2ad
to
6c960f4
Compare
Thanks a lot @matthewei! |
@matthewei There are lane failures. For example, the unit tests lane says:
Can you please to build and test locally? To do so:
|
OK, will do it |
|
@matthewei you probably need to deploy storage to the cluster. Try: > export KUBEVIRT_STORAGE=rook-ceph-default
> make cluster-up && make cluster-sync |
ok , Come back and ready going on it |
6c960f4
to
969c17d
Compare
0a6da2b
to
58afafd
Compare
Signed-off-by: shenwei <shenwei_yewu@cmss.chinamobile.com>
58afafd
to
1aad167
Compare
@iholder101 If I want to exec the command |
In order to do so you need to be a community member. /test pull-kubevirt-build I also suggest to try and building, running unit tests, and preferably running some functional tests locally before triggering CI. |
@matthewei: 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-sigs/prow repository. I understand the commands that are listed here. |
PR needs rebase. 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-sigs/prow repository. |
What this PR does / why we need it:
Sometimes we want to set hostname for CloneVM just as the VM which can be set hostname.
we can realize this function based on the following
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 #10742
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: