Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Add VM name validation #688

Merged
merged 2 commits into from
Sep 14, 2020
Merged

Conversation

darkowlzz
Copy link
Contributor

Adds VM name validation using IsDNS1123Subdomain from k8s api-machinery
validator package.

Updates all the e2e tests to replace "_" in the VM names with "-". Underscore
in the name is not a valid DNS subdomain name.

$ sudo ./bin/ignite create weaveworks/ignite-ubuntu --name my_vm
FATA[0000] metadata.name: Invalid value: "my_vm": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Fixes #622

Add VM name validation using IsDNS1123Subdomain from k8s api-machinery
validator package.
As per the new VM name validation, names with underscore are invalid.
Replace "_" with "-" in all the test VM names.
@darkowlzz darkowlzz added the kind/enhancement Categorizes issue or PR as related to improving an existing feature. label Sep 14, 2020
@stealthybox stealthybox merged commit 4034bc8 into weaveworks:master Sep 14, 2020
@darkowlzz darkowlzz deleted the name-validation branch September 14, 2020 15:13
@stealthybox stealthybox added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/enhancement Categorizes issue or PR as related to improving an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate Object Meta for VM objects
2 participants