grafana / grafana-app-sdk

An SDK for developing apps for grafana using kubernetes-like storage and operators
Apache License 2.0
48 stars 8 forks source link

Check during operator creation that finalizer/name is not too long. #320

Closed jeschkies closed 4 months ago

jeschkies commented 5 months ago

For Loki's usage tracker operator I received this error:

{"time":"2024-06-14T13:54:37.438111611Z","level":"ERROR","msg":"error adding finalizer: CostAttributionLabelName.grafana-attributions-app.ext.grafana.com \"costattributionlabelnames.grafana-attributions-app.ext.grafana.com\" is invalid: metadata.finalizers: Invalid value: \"usage-tracker-config-operator-costattributionlabelnames-finalizer\": name part must be no more than 63 characters"}

usage-tracker-config-operator is configured by

runner, err := simple.NewOperator(simple.OperatorConfig{
        Name:       "usage-tracker",
})

this should return an error when the name is too long.

IfSentient commented 4 months ago

Resolved by https://github.com/grafana/grafana-app-sdk/pull/321