-
Notifications
You must be signed in to change notification settings - Fork 35
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
MTV-1744 | Allow dots in the VM names #1281
base: main
Are you sure you want to change the base?
Conversation
Issue: Right now we are not allowing to keep the VM names which have the dots in the name but we replace the dots with dashes. Fix: Use the IsDNS1123Subdomain validation instead of IsDNS1123Label and ignore the dots in the replacemnet of the new name. Signed-off-by: Martin Necas <[email protected]>
Quality Gate passedIssues Measures |
@@ -33,7 +33,7 @@ func (r *KubeVirt) changeVmNameDNS1123(vmName string, vmNamespace string) (gener | |||
|
|||
// changes VM name to match DNS1123 RFC convention. | |||
func changeVmName(currName string) string { | |||
var underscoreExcluded = regexp.MustCompile("[_.]") | |||
var underscoreExcluded = regexp.MustCompile("[_]") |
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.
we also need to replace or remove "." if it is in the start or end of the name
https://github.com/kubernetes/apimachinery/blob/master/pkg/util/validation/validation.go#L206
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.
ahh yeah good point!
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.
hmm that's get tricky
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.
remove the "." if they are in the start of end ?
Issue:
Right now we are not allowing to keep the VM names which have the dots in the name but we replace the dots with dashes.
Fix:
Use the IsDNS1123Subdomain validation instead of IsDNS1123Label and ignore the dots in the replacemnet of the new name.
Ref:
https://issues.redhat.com/browse/MTV-1744