Kubebuilder: KubeBuilder doesn't validate that project names are valid namespace names

Created on 25 Jul 2019  路  7Comments  路  Source: kubernetes-sigs/kubebuilder

make deploy
/Users/jude/Programing/Go/Libraries/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
kubectl apply -f config/crd/bases --validate=false
customresourcedefinition "guestbooks.webapp.my.domain" configured
kustomize build config/default | kubectl apply -f - --validate=false
customresourcedefinition "guestbooks.webapp.my.domain" configured
clusterrole "KubeBuilder-manager-role" created
clusterrole "KubeBuilder-proxy-role" created
clusterrolebinding "KubeBuilder-manager-rolebinding" created
clusterrolebinding "KubeBuilder-proxy-rolebinding" created
Error from server (Invalid): error when creating "STDIN": Namespace "KubeBuilder-system" is invalid: metadata.name: Invalid value: "KubeBuilder-system": 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])?')
Error from server (NotFound): error when creating "STDIN": namespaces "KubeBuilder-system" not found
Error from server (NotFound): error when creating "STDIN": namespaces "KubeBuilder-system" not found
Error from server (NotFound): error when creating "STDIN": namespaces "KubeBuilder-system" not found
Error from server (NotFound): error when creating "STDIN": namespaces "KubeBuilder-system" not found
make: *** [deploy] Error 1
kinbug lifecyclstale prioritimportant-longterm

All 7 comments

Any update here ?

did you name your project kubebuilder? We should probably check project names at init time and project load time...

/kind bug
/priority important-longterm

Getting a similar error when deploying the build configs in a project with a long name:

The Service "ververica-platform-k8s-controller-controller-manager-metrics-service" is invalid: metadata.name: Invalid value: "ververica-platform-k8s-controller-controller-manager-metrics-service": must be no more than 63 characters

yeah, same issue as before -- the full name must be small enough to fit in a DNS section name. We should validate, and maybe shorten some of our suffixes that we use.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/assign @camilamacedo86

Working on it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

functicons picture functicons  路  4Comments

cmoulliard picture cmoulliard  路  3Comments

narayanasamyr picture narayanasamyr  路  4Comments

camilamacedo86 picture camilamacedo86  路  4Comments

kuroneko25 picture kuroneko25  路  3Comments