nephio-project / nephio

Nephio is a Kubernetes-based automation platform for deploying and managing highly distributed, interconnected workloads such as 5G Network Functions, and the underlying infrastructure on which those workloads depend.
Apache License 2.0
93 stars 52 forks source link

Porch UI: Add syntax control for deployment name #665

Open liamfallon opened 2 months ago

liamfallon commented 2 months ago

Original issue URL: https://github.com/kptdev/kpt/issues/3613 Original issue user: https://github.com/debeaueric Original issue created at: 2022-10-11T20:35:55Z Original issue last updated at: 2022-11-15T21:55:30Z Original issue body: ### Describe your problem

When creating a new deployment via the Porch UI, there is no control on the deployment name. However, the deployment name is used to create some secrets and may not respect the regex rules required by Kubernetes for secrets. The name of a Secret object must be a valid DNS subdomain name.

Example of problem faced when using a deployment name starting via an upper case.

Secret "Scaled-sync" is invalid: metadata.name: Invalid value: "Scaled-sync": a lowercase RFC 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])?)*')

Original issue comments: Comment user: https://github.com/johnbelamaric Comment created at: 2022-10-11T20:53:50Z Comment last updated at: 2022-10-11T20:53:50Z Comment body: Eric, I assume you used https://github.com/nephio-project/nephio-packages/tree/main/nephio-webui to deploy the webui?

Can you detail the process you used? I think if I added kubeval as a validation function this may have been caught earlier, but would like to understand your workflow to be sure.

Comment user: https://github.com/debeaueric Comment created at: 2022-10-12T08:23:30Z Comment last updated at: 2022-10-12T08:23:30Z Comment body: Hello John, I used this package to deploy the webui on a GCP cluster as described in the Nephio core-dns PoC https://github.com/nephio-project/nephio-poc