Open odinnordico opened 2 years ago
Hello @odinnordico! Welcome to the Cartographer community and thank you for opening your first issue, we appreciate your contributions
Considering two options:
Hey @odinnordico , thanks for reporting!
I was trying to gather some more context here, and end up looking at what knative is making use of for that check - https://github.com/knative/serving/blob/d5d489c0babd5c9ae9a37d707c06df92d70711f5/vendor/knative.dev/pkg/apis/metadata_validation.go#L37-L47 seems quite relevant.
Given that the name of the Workload/Deliverable/etc is made part of the children labelset
it might be worth at least performing such validation in the name to prevent further problems w/ setting them in labelsets (although +1 on having a bigger discussion on to what degree we should be strict about it).
It's tricky that template authors are able to make use of the name wherever they want (through #@ workload.metadata.name
or $(workload.metadata.name)$
, but I imagine that with a smaller, more restrictive naming scheme, it might reduce the possible amount of mistakes one can make)
see https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
Valid label value:
- must be 63 characters or less (can be empty),
- unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]),
- could contain dashes (-), underscores (_), dots (.), and alphanumerics between.
PR sent out months ago. Was held for possible breaking changes. Need to review at next pre/IPM.
Block on upgrade documentation to describe potential breaking change.
We should be following - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names
[ ] Check behviour is only on 'Edit' for workload/template [ ] Document in OSS docs for template/workload [ ] Check code for pre/post upgrade awareness [ ] Document what happens on upgrade, and how to deal with it if you upgrade without patching first (include error that occurs when trying to edit)
Bug description:
Cartographer allow to create workloads with names that does not complain with all possible components in the supply chain, being able to create a workload with name with dot(
.
) in it, but failing when try to create a knative service using it as CNR.Steps to reproduce:
Having a TAP 1.0.0 cluster configured with full profile and using tanzu apps plugin to create resources in the supply chain:
yaml
file (tanzu-java-web-app-2.6.yaml
) with name containing dots (.
)cli
:tanzu apps workload create -y --tail --wait --tail-timestamp -f tanzu-java-web-app-2.6.yaml
app
created:kubectl get apps.kappctrl.k14s.io
Useful Error Message
:kubectl describe apps.kappctrl.k14s.io tanzu-java-web-app-2.6
workloads
:tanzu apps workload list
Expected behavior:
Cartographer should not allow to create resource with names which are not aligned with itself, this creation intent must be rejected with an useful error
Actual behavior:
Resource with not aligned name is created but fails in following supply chain steps
Logs, k8s object dumps:
Versions:
Deployment info:
Check Steps
Additional context: