-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add validation for image-cloning and custom-images for kubevirt #1517
Add validation for image-cloning and custom-images for kubevirt #1517
Conversation
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.
looks, small changes to help debugging/support.
switch c.OSImageSource.PVC.Namespace { | ||
case c.Namespace: | ||
if !c.AllowCustomImages { | ||
return errInvalidOsImage |
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.
May be we should return a more specific error that explains that custom image is not allowed.
It's a bit different from being invalid.
return nil | ||
} | ||
|
||
func validateKubeVirtImages(sourcePVC string, existingDiskList cdiv1beta1.DataVolumeList, config *Config) bool { |
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.
Same here, can we return different specific errors:
- standard image cloning not allowed
- custom image cloning not allowed
- invalid OS Image
?
That will help in the logs.
d28ff5f
to
66cec14
Compare
Signed-off-by: Sankalp Rangare <[email protected]>
66cec14
to
6b27c31
Compare
/lgtm |
LGTM label has been added. Git tree hash: 9b3fe808c43a4e049960b4ac08601d4b02daa729
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hdurand0710, sankalp-r 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 Review the full test history Silence the bot with an |
5 similar comments
/retest Review the full test history Silence the bot with an |
/retest Review the full test history Silence the bot with an |
/retest Review the full test history Silence the bot with an |
/retest Review the full test history Silence the bot with an |
/retest Review the full test history Silence the bot with an |
/hold |
/hold cancel |
/retest |
/hold |
/unhold |
What this PR does / why we need it:
This PR adds validation for PVC osImageSource for kubevirt machines.
Using standard cloned images and custom-images are allowed only if the respective option is enabled.
Which issue(s) this PR fixes:
Fixes #kubermatic/kubermatic#11234
What type of PR is this?
/kind feature
Special notes for your reviewer:
Does this PR introduce a user-facing change? Then add your Release Note here:
Documentation:
Signed-off-by: Sankalp Rangare [email protected]