Uploaded image for project: 'Cluster Observability Operator'
  1. Cluster Observability Operator
  2. COO-1261

ObservabilityInstaller CRD missing metadata name length validation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • cluster-observability
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description:{}

      Summary:{}

      The ObservabilityInstaller Custom Resource Definition (CRD) is missing validation rules for metadata.name field length, allowing creation of resources with excessively long names that exceed Kubernetes naming conventions.

      Issue Details:{}

      When creating an ObservabilityInstaller CR with a very long name (exceeding normal Kubernetes resource name limits), the resource is created successfully instead of being rejected with a validation error.

      Test Case:{}

        apiVersion: observability.openshift.io/v1alpha1
        kind: ObservabilityInstaller
        metadata:
          name: test-very-long-name-that-exceeds-normal-kubernetes-resource-name-limits-and-should-be-validated-properly
        spec:
          capabilities:
            tracing:
              operators:
                install: true
      

      Errors in operator logs:

      2025-10-06T14:31:49Z INFO cluster-observability Reconcile called {"request": {"name":"test-very-long-name-that-exceeds-normal-kubernetes-resource-name-limits-and-should-be-validated-properly","namespace":"observability-operator"}}
      2025-10-06T14:31:49Z ERROR cluster-observability Failed to reconcile {"error": "Subscription.operators.coreos.com \"opentelemetry-product\" is invalid: metadata.labels: Invalid value: \"test-very-long-name-that-exceeds-normal-kubernetes-resource-name-limits-and-should-be-validated-properly\": must be no more than 63 characters"}
      github.com/rhobs/observability-operator/pkg/controllers/observability.observabilityInstallerController.Reconcile
       /workspace/pkg/controllers/observability/observability_controller.go:127
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile
       /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:119
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler
       /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:340
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem
       /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:300
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.1
       /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:202
      2025-10-06T14:31:50Z INFO cluster-observability Reconcile called {"request": {"name":"test-very-long-name-that-exceeds-normal-kubernetes-resource-name-limits-and-should-be-validated-properly","namespace":"observability-operator"}}
      2025-10-06T14:31:50Z INFO cluster-observability Reconcile called {"request": {"name":"test-very-long-name-that-exceeds-normal-kubernetes-resource-name-limits-and-should-be-validated-properly","namespace":"observability-operator"}}
      2025-10-06T14:31:51Z INFO cluster-observability Reconcile called {"request": {"name":"test-very-long-name-that-exceeds-normal-kubernetes-resource-name-limits-and-should-be-validated-properly","namespace":"observability-operator"}}
      

      Expected Behavior:{}

      Resource creation should fail with a validation error indicating the name exceeds the maximum allowed length.

      Actual Behavior:{}

      Resource is created successfully without any validation error.

      Root Cause:{}

      The CRD schema in bundle/manifests/observability.openshift.io_observabilityinstallers.yaml defines the metadata field as simply type: object (line 50) without any validation constraints on the name field.

      Acceptance Criteria:{}

        - Need validation rules to the CRD schema for metadata.name field

        - Validate that resource names follow Kubernetes DNS subdomain naming conventions

        - Ensure names are limited to 253 characters maximum

              ploffay@redhat.com Pavol Loffay
              rhn-support-ikanse Ishwar Kanse
              None
              None
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: