machine-controller-manager icon indicating copy to clipboard operation
machine-controller-manager copied to clipboard

AWS Machine Class name validation doesn't allow "."

Open jsravn opened this issue 4 years ago • 2 comments

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:

jsravn avatar May 25 '21 10:05 jsravn

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.

prashanth26 avatar May 25 '21 12:05 prashanth26

https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go is the validation lib.

jsravn avatar May 25 '21 13:05 jsravn

/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

himanshu-kun avatar Feb 14 '23 12:02 himanshu-kun