machine-controller-manager
machine-controller-manager copied to clipboard
AWS Machine Class name validation doesn't allow "."
What happened:
E0525 10:15:39.042133 1 awsmachineclass.go:173] Validation of AWSMachineClass failed metadata.name: Invalid value: "mcm-immutable-r5.4xlarge-canary-az-b": [-a-z0-9]+ (regex used for validation is 'name-40d-0983-1b89')
What you expected to happen:
It should not fail validation. Kubernetes object names are allowed to have . in them.
How to reproduce it (as minimally and precisely as possible):
Create a machine class with a . in the name.
Anything else we need to know: I made an issue for this because it's unclear if this is intentional or not. I can't see a reason for it. The related code should probably be using the k8s regex rather than making its own.
Environment:
Hi @jsravn .
I don't think this was intentional. It's probably just something we overlooked in the past. I think it makes sense to align the validation similar to k8s regexp.
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go is the validation lib.
/close We have moved the code out of tree, and now we follow the kubernetes validation for name of the object Also provider specific machineClasses are no longer supported