Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-2352

Deployment-Config automatic trigger issue

XMLWordPrintable

    • Important
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      The DeploymentConfig trigger for automtic update/rollout, even though set to false/disabled.
      
      Even with this trigger disabled, when you manually change image in the DC it spawns new RC with reason "image change".
      
      ~~~
      sh-4.2# oc get dc
      NAME REVISION DESIRED CURRENT TRIGGERED BY
      example 1 1 0 image(httpd:latest)
      
      sh-4.2# oc get rc
      NAME DESIRED CURRENT READY AGE
      example-1 0 0 0 7h58m
      
      ("disabling automatic")
      sh-4.2# oc edit dc
      deploymentconfig.apps.openshift.io/example edited
      
      sh-4.2# oc get dc
      NAME REVISION DESIRED CURRENT TRIGGERED BY
      example 1 1 0
      
      (Changing
      spec.template.spec.containers.image: image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest to spec.template.spec.containers.image: image-registry.openshift-image-registry.svc:5000/openshift/httpd )
      sh-4.2# oc edit dc
      deploymentconfig.apps.openshift.io/example edited
      
      sh-4.2# oc get dc
      NAME REVISION DESIRED CURRENT TRIGGERED BY
      example 2 1 0
      
      sh-4.2# oc get rc
      NAME DESIRED CURRENT READY AGE
      example-1 0 0 0 7h58m
      example-2 1 1 0 7s
      
      sh-4.2# oc describe rc example-2
      (...)
      openshift.io/deployment.status-reason: image change

      Version-Release number of selected component (if applicable):

       

      How reproducible:

       

      Steps to Reproduce:

      1. oc new-project test-httpd 
      2. oc new-app --template httpd-example
          # remove config change trigger
      3.    oc patch dc httpd-example --type=json -p='[{"op": "remove", "path": "/spec/triggers/1"}]'
          # change the imagechange trigger
      4. oc patch dc httpd-example --type=json -p='[{"op": "replace", "path": "/spec/triggers/0/imageChangeParams/automatic", "boolean":"false"}]' 2.
      
      The automatic being set to false removed the trigger from the `oc get dc` output, but the trigger is still active.
      
      So if we edit the dc and change image tag manually, it will always trigger new rollout because automatic being set to false removed the trigger from the `oc get dc`.
       

      Actual results:

      The trigger should not be active, and rollout of new rc should not trigger.

      Expected results:

      The trigger should stop.

      Additional info:

      The problem is that with imageChangeParams.automatic set to false, manual change is still triggering the rollout with reason being:
      Name:         example-2
      Namespace:    (....)
      Selector:     app=httpd,deployment=example-2,deploymentconfig=example
      Labels:       openshift.io/deployment-config.name=example
      Annotations:  (...)
                    openshift.io/deployment.status-reason: image changeIf we decide to manually rollout the "example" we'll get information, that the reason behind the deployment is:
      Name:         example-3
      Namespace:    (...)
      Selector:     app=httpd,deployment=example-3,deploymentconfig=example
      Labels:       openshift.io/deployment-config.name=example
      Annotations: (...)
                    openshift.io/deployment.status-reason: manual change
      
      We can remove the whole "ImageChange" trigger altogether and set non-existent "webhook" - e.g
      triggers:
        - type: GitHub
      
      And then manual changes to the image are not triggering the rollout.
      The main question here, is what exactly is "imageChangeParams.automatic set to false" is disabling and if there's another way on disabling the rollout on manual changes, other than removing the "ImageChange" trigger as a whole.

       

       

            fkrepins@redhat.com Filip Krepinsky
            rhn-support-hjaiswal Himanshu Jaiswal
            Jitendar Singh Jitendar Singh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: