Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-8063

The length and charset of the names used in OpenStackControlPlane CR are not validated

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • ?
    • ?
    • ?
    • Low

      There are user defined strings in OpenStackControlPlane CR that later used as CR names or other k8s resource name (e.g. statefulset) but these strings are not validated by the openstack-operator even though k8s resource names has both length and character set restrictions.

      Example failures:

      1. length:
        • add a memcached instance named "memcached-foo-bar-baz-gaz-1234567890-1234567890-1234567890"
        • it will be accepted but the corresponding statefulset never reaches readiness.
      2. charset:
        • add a memcached instance named "memcached_foo"
        • it will be accepted but openstack-operator cannot create the related Memcached CR due to
           
          2024-06-27T11:43:11.227Z	ERROR	Reconciler error	{"controller": "openstackcontrolplane", "controllerGroup": "core.openstack.org", "controllerKind": "OpenStackControlPlane", "OpenStackControlPlane": {"name":"openstack-galera-network-isolation","namespace":"openstack"}, "namespace": "openstack", "name": "openstack-galera-network-isolation", "reconcileID": "438f99a1-399a-486d-a2eb-30d1629290f6", "error": "memcached_foo(Certificate.cert-manager.io \"memcached_foo-svc\" is invalid: metadata.name: Invalid value: \"memcached_foo-svc\": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'))"}
          sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
          	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.6/pkg/internal/controller/controller.go:329
          sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
          	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.6/pkg/internal/controller/controller.go:266
          sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
          	/opt/app-root/src/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.6/pkg/internal/controller/controller.go:227
          
          

      This is probably not limited to the memchached handling but applies to other user defined string in OpenStackControlPlane used as resource names later e.g.:

      • spec.rabbitmq.templates.<name>
      • spec.galera.tempates.<name>
      • spec.glance.template.glanceAPIs.<name>

            rhn-support-mschuppe Martin Schuppert
            rh-ee-bgibizer Balazs Gibizer
            rhos-dfg-ospk8s
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: