Chia-Network / chia-operator

A Kubernetes operator for Chia
Apache License 2.0
3 stars 0 forks source link

Long namespace names can cause reconciler errors #166

Closed Starttoaster closed 1 month ago

Starttoaster commented 1 month ago

A "provenance" label gets added to each resource created by the operator. The actual key of the provenance label is k8s.chia.net/provenance. Normally the value of this label is just something like ChiaNode.chia-blockchain-testnet11.node in the format of Kind.namespace.name, which is fine as it doesn't exceed the limit for a label's key or value of 63 chars. However, if someone were to use an unusually long namespace or name for an operator managed resource (eg. ChiaNode) then the reconciler will fail with an error like the following:

ChiaNodeReconciler ChiaNode=synctest-testnet11-a6a27bfe8e8d3e3db16701e7a33182ac11ce0723/synctest-node error creating Service \"synctest-node-node\": Service \"synctest-node-node\" is invalid: [metadata.labels: Invalid value: \"ChiaNode.synctest-testnet11-a6a27bfe8e8d3e3db16701e7a33182ac11ce0723.synctest-node\": must be no more than 63 characters, spec.selector: Invalid value: \"ChiaNode.synctest-testnet11-a6a27bfe8e8d3e3db16701e7a33182ac11ce0723.synctest-node\": must be no more than 63 characters]
Starttoaster commented 1 month ago

Solved in release 0.9.0