Bug 2091029 - Cancel rollout action only appears when rollout is completed
Summary: Cancel rollout action only appears when rollout is completed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.11.0
Assignee: Yadan Pei
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-27 11:26 UTC by Yadan Pei
Modified: 2022-08-10 11:15 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 11:14:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Cancel rollout is available (86.87 KB, image/png)
2022-06-20 05:29 UTC, Yadan Pei
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 11648 0 None open Bug 2091029: - Cancel rollout action only appears when rollout is completed 2022-06-06 15:23:40 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:15:00 UTC

Description Yadan Pei 2022-05-27 11:26:12 UTC
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

Comment 1 Jakub Hadvig 2022-05-31 09:37:08 UTC
The functionality for cancelling rollout was added in the Add suport for PDB PR - https://github.com/openshift/console/pull/10445

Comment 2 Cyril 2022-06-02 20:35:04 UTC
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?

Comment 3 Yadan Pei 2022-06-06 07:19:55 UTC
Hi cajieh

'Cancel rollout' action is only available for RC, DC doesn't have 'Cancel rollout' at any time

Could you please try RC?

Comment 4 Cyril 2022-06-06 19:17:14 UTC
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.

Comment 6 Yadan Pei 2022-06-20 05:29:09 UTC
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

Comment 8 errata-xmlrpc 2022-08-10 11:14:36 UTC
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


Note You need to log in before you can comment on or make changes to this bug.