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

Heat Operator webhook should allow null > something valid databaseInstance changes

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Done
    • Icon: Normal Normal
    • rhos-18.0.1
    • rhos-18.0 Beta
    • heat-operator
    • None
    • Heat Operator webhook should allow null > something valid databaseInstance changes
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • No Docs Impact
    • ?
    • ?
    • 0% To Do, 0% In Progress, 100% Done

      Summary

      Heat Operator should allow the transition between `databaseInstance: null` to `databaseInstance: <somethingValid>` and not block with the webhook.

      Details

      When Heat is enabled in the `OpenStackControlPlane` without a setting for `databaseInstance` it will automatically be set to an empty string "":

      [root@titan132 ospdo-migration]# oc get oscp openstack -o jsonpath='{.spec.heat}' | jq '. | "enabled=\(.enabled), databaseInstance=\(.template.databaseInstance)"'
      "enabled=false, databaseInstance=null" 

      If the user tries to change this to something valid during adoption, this change will be blocked by the webhook.

      [root@titan132 ospdo-migration]# oc patch openstackcontrolplane openstack -n ${OSP18_NAMESPACE} --type=merge --patch '
      spec:
        heat:
          enabled: true
          apiOverride:
            route: {}
          template:
            databaseInstance: openstack
            databaseAccount: heat
            secret: osp-secret
            memcachedInstance: memcached
            passwordSelectors:
              authEncryptionKey: HeatAuthEncryptionKey
              database: HeatDatabasePassword
              service: HeatPassword
      '
      Warning: unknown field "spec.heat.template.passwordSelectors.database"
      The OpenStackControlPlane "openstack" is invalid: spec.databaseInstance: Forbidden: Changing the DatabaseInstance is not supported for existing deployments 

      Expected behaviour

      This action should be allowed by the webhook. So we need to first check if `databaseInstance` is empty, if it is then we can bypass the validation

              rhn-support-bshephar Brendan Shephard
              rhn-support-bshephar Brendan Shephard
              rhos-dfg-df
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: