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

Sub-resource kubebuilder-based defaulting doesn't trigger when that resource is missing from applied control plane CR

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • rhos-18.0.17 FR 5
    • openstack-operator
    • None
    • Low

      This would apply to any other subsection of the controlplane CR. CloudKitty is just the current example of the behavior.

       

      To Reproduce Steps to reproduce the behavior:

      1. Apply an openstackcontrolplane CR with the .spec.telemetry.template.cloudkitty completely missing
      2. Retrieve openstackcontrolplane with `oc get oscp <name> -oyaml`
      3. See that most of CloudKitty is set to zero values

      Expected behavior

      Bug impact

      • This impacts users applying a CR with CloudKitty missing. This would impact anyone having FR4 or earlier and updating to FR5 - CloudKitty section won't get populated.

      Known workaround

      • Patch the CloudKitty section to empty struct to trigger the defaulting
      oc patch oscp <controlplane CR name> --type='json' -p='[{"op": "replace", "path": "/spec/telemetry/template/cloudkitty", "value":{}}]' 

      Additional context

      • CK section, that's not correctly defaulted
              cloudkitty:
                apiTimeout: 0
                auth: {}
                cloudKittyAPI:
                  override: {}
                  replicas: 1
                  resources: {}
                  tls:
                    api:
                      internal: {}
                      public: {}
                cloudKittyProc:
                  replicas: 1
                  resources: {}
                  tls: {}
                databaseAccount: ""
                databaseInstance: ""
                enabled: false
                lokiRetentionDays: 0
                lokiStackSize: ""
                memcachedInstance: ""
                messagingBus:
                  cluster: rabbitmq
                passwordSelector:
                  aodhService: ""
                  ceilometerService: ""
                  cloudKittyService: ""
                period: 0
                preserveJobs: false
                s3StorageConfig:
                  schemas:
                  - effectiveDate: "2020-10-11"
                    version: v11
                  secret:
                    name: ""
                    type: ""
                secret: ""
                serviceUser: "" 
      • CK section that is correctly defaulted (what we want to get instead)
              cloudkitty:
                apiTimeout: 60
                auth: {}
                cloudKittyAPI:
                  override: {}
                  replicas: 1
                  resources: {}
                  tls:
                    api:
                      internal: {}
                      public: {}
                cloudKittyProc:
                  replicas: 1
                  resources: {}
                  tls: {}
                databaseAccount: cloudkitty
                databaseInstance: openstack
                enabled: false
                lokiRetentionDays: 95
                lokiStackSize: 1x.demo
                memcachedInstance: memcached
                messagingBus:
                  cluster: rabbitmq
                passwordSelector:
                  aodhService: AodhPassword
                  ceilometerService: CeilometerPassword
                  cloudKittyService: CloudKittyPassword
                period: 300
                preserveJobs: false
                s3StorageConfig:
                  schemas:
                  - effectiveDate: "2020-10-11"
                    version: v11
                  secret:
                    name: cloudkitty-loki-s3
                    type: s3
                secret: osp-secret
                serviceUser: cloudkitty

              lmadsen@redhat.com Leif Madsen
              rh-ee-jwysogla Jaromir Wysoglad
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: