Linkerd2: Add validation to the New Service Profile popup form

Created on 12 Mar 2019  路  3Comments  路  Source: linkerd/linkerd2

The "New Service profile" popup form isn't validating proper values for the Service nor the Namespace fields

image

Trying to apply a service or a namespace with bad syntax triggers the following error, which might give a hint on the validation function to be used in this form:

Invalid value: "foo bar": a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')

areweb enhancement good first issue help wanted

All 3 comments

Flagging that @liquidslr is taking this issue, see discussion in #2479

@alpeb are the restrictions for namespace and service the same?

@liquidslr Yes. If you try saving a service or a namespace with a string not abiding to the regex above, it will through the same error message.

Was this page helpful?
0 / 5 - 0 ratings