3scale-operator icon indicating copy to clipboard operation
3scale-operator copied to clipboard

CustomPolicy reconcilliation issue

Open eguzki opened this issue 3 years ago • 0 comments

Steps to reproduce

  1. Create APIManager CR with custom policy
spec:
  apicast:
    stagingSpec:
       customPolicies:
           - name: Example
             version: "0.1"
             secretRef:
                name: policy
  1. Edit APIMamanger CR: just update the letter case of the custom policy name
spec:
  apicast:
    stagingSpec:
       customPolicies:
           - name: example
             version: "0.1"
             secretRef:
                name: policy

Then, the deploymnent config has two volumemounts. It is expected to have only one.

Initially, with the original CR, the deployment config looked like this:

apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  annotations:
    apps.3scale.net/apicast-policy-volume-550ce71bf15f7ab80906b5e066d2fc30: policy-01-example

spec:
  template:
     spec:
        volumes:
          - name: policy-01-example
            secret:
               defaultMode: 420
               secretName: policy
         containers:
            - volumeMounts:
                 - mountPath: /opt/app-root/src/policies/Example/0.1
                   name: policy-01-example
                   readOnly: true

After the CR change, it looks like this:

apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  annotations:
    apps.3scale.net/apicast-policy-volume-550ce71bf15f7ab80906b5e066d2fc30: policy-01-example

spec:
  template:
     spec:
        volumes:
          - name: policy-01-example
            secret:
               defaultMode: 420
               secretName: policy
         containers:
            - volumeMounts:
                 - mountPath: /opt/app-root/src/policies/Example/0.1
                   name: policy-01-example
                   readOnly: true
            - volumeMounts:
                 - mountPath: /opt/app-root/src/policies/example/0.1
                   name: policy-01-example
                   readOnly: true

eguzki avatar Jan 20 '22 16:01 eguzki