Description of problem: Cancel rollout is only available when deployment finished, user can not cancel rollout on web console Version-Release number of selected component (if applicable): 4.11.0-0.nightly-2022-05-25-193227 How reproducible: Always Steps to Reproduce: 1. create deploymentconfig # cat dc-with-pre-mid-post.yaml apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: labels: name: hello-openshift name: hooks spec: replicas: 1 revisionHistoryLimit: 2 selector: name: hello-openshift strategy: recreateParams: mid: execNewPod: command: - /bin/bash - -c - /usr/bin/sleep 5 containerName: hello-openshift env: - name: VAR value: mid-deployment volumes: - dataem failurePolicy: Abort post: execNewPod: command: - /bin/bash - -c - /usr/bin/sleep 5 containerName: hello-openshift env: - name: VAR value: post-deployment volumes: - dataem failurePolicy: Ignore pre: execNewPod: command: - /bin/bash - -c - /usr/bin/sleep 5 containerName: hello-openshift env: - name: VAR value: pre-deployment volumes: - dataem failurePolicy: Ignore timeoutSeconds: 600 resources: {} type: Recreate template: metadata: creationTimestamp: null labels: name: hello-openshift spec: containers: - command: - /bin/bash - -c - /usr/bin/sleep 30d env: - name: MYSQL_USER value: user8Y2 - name: MYSQL_PASSWORD value: Plqe5Wev - name: MYSQL_DATABASE value: root image: quay.io/openshift/origin imagePullPolicy: Always name: hello-openshift ports: - containerPort: 8080 protocol: TCP resources: {} securityContext: capabilities: {} privileged: false terminationMessagePath: /dev/termination-log volumeMounts: - mountPath: /var/lib/origin name: dataem dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} terminationGracePeriodSeconds: 30 volumes: - emptyDir: {} name: dataem test: false triggers: - type: ConfigChange status: availableReplicas: 1 details: causes: - type: ConfigChange message: caused by a config change latestVersion: 101 observedGeneration: 101 replicas: 1 updatedReplicas: 1 # oc create -f dc-with-pre-mid-post.yaml 2. Trigger DC rollout either via CLI or web console(DeploymentConfigs -> hooks -> Actions -> Start rollout) 3. Try to Cancel rollout when deployment is in progress via web on RC lists page kebab menu Actual results: 3. 'Cancel rollout' menu is not in actions/kebab menu when roll out is in progress, instead it appears after rollout completed Expected results: 3. 'Cancel rollout' action should be available so that user can cancel some in progress deployment, it doesn't seem make sense that 'Cancel rollout' is shown after deployment finish Additional info: 'oc rollout' is working as expected $ oc rollout latest hooks deploymentconfig.apps.openshift.io/hooks rolled out $ oc get rc NAME DESIRED CURRENT READY AGE hooks-1 0 0 0 10m hooks-2 0 0 0 9m42s hooks-3 1 1 1 8m23s hooks-4 0 0 0 3s -> the latest rc $ oc rollout cancel dc/hooks -> cancel the rollout Warning: would violate PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "hello-openshift" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "hello-openshift" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "hello-openshift" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "hello-openshift" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost") $ oc get rc NAME DESIRED CURRENT READY AGE example-1 0 0 0 6m56s example-2 0 0 0 6m28s example-3 3 3 3 3m18s hooks-1 0 0 0 11m hooks-2 0 0 0 10m hooks-3 1 1 0 8m54s hooks-4 0 0 0 34s -> replicas is still 0 $ oc rollout cancel dc/hooks No rollout is in progress (latest rollout #4 failed about a minute ago) hooks-4 is cancelled successfully so it is in failed status
The functionality for cancelling rollout was added in the Add suport for PDB PR - https://github.com/openshift/console/pull/10445
yapei Seems the same issue exists in versions 4.10 and 4.9. I doubt if my changes for Add support to PDB have any impact on the issue. However I tried to reproduce but I didn’t see the Cancel button for DC before or after completion. Could you please add some screenshots? Should this behaviour be similar to RC?
Hi cajieh 'Cancel rollout' action is only available for RC, DC doesn't have 'Cancel rollout' at any time Could you please try RC?
yapei Oh I see the issue now! I refactored the Cancel action for RC to support custom action used for Add support for PDB. I have opened a PR to address the issue.
Created attachment 1891222 [details] Cancel rollout is available 'Cancel rollout' action is now available when RC is Running verified on 4.11.0-0.nightly-2022-06-18-081846
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:5069