operator-sdk icon indicating copy to clipboard operation
operator-sdk copied to clipboard

Release name must not be longer than 53

Open tamasborsstriva opened this issue 1 year ago • 1 comments

Bug Report

What did you do?

I have custom resource, which's length can be longer than 53 characters. The resource is synced from a vritual cluster, and the syncer puts extras to the resource name which I can not control. (adds the name of the namespace in the virtual cluster, and of the name virtual cluster)

What did you expect to see?

operator is able to create the release

What did you see instead? Under which circumstances?

manager {"level":"error","ts":"2024-03-22T12:19:55Z","msg":"Reconciler error","controller":"mongodatabase-controller","object":{"name":"dbasdfasdfsadfasfasasfsadfasfsafsa-x-thenamespace-x-harom","namespace":"vcluster-harom"},"namespace":"vcluster-harom","name":"dbasdfasdfsadfasfasasfsadfasfsafsa-x-thenamespace-x-harom"reconcileID":"823a9da8-6582-460d-824d-f9fa91631930","error":"failed to install release: release name \"dbasdfasdfsadfasfasasfsadfasfsafsa-x-thenamespace-x-harom\": invalid release name, must match regex ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ and the length must not be longer than 53","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:324\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:265\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:226"}

Environment

Operator type:

helm

Opertaror version:

v1.33.0

Kubernetes cluster type:

v1.29.2

Possible Solution

trim the release name, or use hash

Additional context

tamasborsstriva avatar Mar 22 '24 13:03 tamasborsstriva

Hi @tamasborsstriva This isn't a limitation in operator-sdk, this is an implementation detail of helm. See Below for more information.

acornett21 avatar Mar 25 '24 20:03 acornett21