Skip to content

ScaledObject invalid due metadata.labels must be no more than 63 characters #6998

Description

@inrdkec

Report

I came across to these issues:

Expected Behavior

KEDA should reject ScaledObject creation when the name is longer than 63 characters.
I believe this would be part of KEDA Webhook, but I dont know if this has been implemented.

Actual Behavior

ScaledObject is created but it keeps in error state as it cannot create the corresponding HPA.

Steps to Reproduce the Problem

  1. Create a ScaledObject with a name longer than 64 characters
  2. ScaledObject should be created but it keeps in error state

Logs from KEDA operator

error:
ScaledObject.keda.sh "xxxxxxxxx-xxxxxx-xxxxxxx-xxxxxxxxx-xxxxx-xxxx-xxxxxxx-xxxxxxxx-xxxx" is invalid: metadata.labels: Invalid value: "xxxxxxxxx-xxxxxx-xxxxxxx-xxxxxxxxx-xxxxx-xxxx-xxxxxxx-xxxxxxxx-xxxx": must be no more than 63 characters

stacktrace: 
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler
	/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:316
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem
	/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:263
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2
	/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:224

KEDA Version

2.16.0

Kubernetes Version

None

Platform

None

Scaler Details

datadog

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstaleAll issues that are marked as stale due to inactivity

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Ready To Ship

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions