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

'oc delete istag/$ISTAG --dry-run=server' is unexpectedly deleting the object from the server

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • No
    • Proposed
    • Enhancement
    • Hide
      Previously, deleting an `istag` resource with the `--dry-run=server` option unintentionally caused actual deletion of the image from the server. This unexpected deletion occurred due to the dry-run option being implemented incorrectly in the 'oc delete istag' command. With this release, the dry-run option is now wired to the 'oc delete istag' command, preventing accidental deletion of image objects and the `istag` object remains intact when using the `--dry-run=server` option. (link:https://issues.redhat.com/browse/OCPBUGS-57206[OCPBUGS-57206])
      Show
      Previously, deleting an `istag` resource with the `--dry-run=server` option unintentionally caused actual deletion of the image from the server. This unexpected deletion occurred due to the dry-run option being implemented incorrectly in the 'oc delete istag' command. With this release, the dry-run option is now wired to the 'oc delete istag' command, preventing accidental deletion of image objects and the `istag` object remains intact when using the `--dry-run=server` option. (link: https://issues.redhat.com/browse/OCPBUGS-57206 [ OCPBUGS-57206 ])
    • None
    • None
    • None
    • None

      This is a clone of issue OCPBUGS-35855. The following is the description of the original issue:

      Description of problem:

      'oc delete istag/$ISTAG --dry-run=server' is unexpectedly deleting the object from the server this is not expected behavior.
      
      - Attempted to delete the `istag` resource object by using the `dry-run=server` option. However, the object(image) was actually deleted from the server.
      - Conversely, when applied the same `dry-run=server` parameter to other resources, they remained intact and were not deleted.

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

      OCP 4.15

      How reproducible:

      Try deleting the `istag` resource using the `--dry-run=server` option with the server strategy.

      Steps to Reproduce:

      1. Example with resource ImageStreamTag istag
      
      ~~~ 
      [quickcluster@upi-0 ~]$ oc delete -n openshift istag/ubi8-openjdk-8:1.11 --dry-run=client
      imagestreamtag.image.openshift.io "ubi8-openjdk-8:1.11" deleted (dry run)
      
      [quickcluster@upi-0 ~]$ oc get istag -n openshift | grep -i ubi8-openjdk-8:1.11
      ubi8-openjdk-8:1.11                                         image-registry.openshift-image-registry.svc:5000/openshift/ubi8-openjdk-8@sha256:022488b1bf697b7dd8c393171a3247bef4ea545a9ab828501e72168f2aac9415                                       4 weeks ago[
      
      quickcluster@upi-0 ~]$ oc delete -n openshift istag/ubi8-openjdk-8:1.11 --dry-run=server
      imagestreamtag.image.openshift.io "ubi8-openjdk-8:1.11" deleted (server dry run)
      
      [quickcluster@upi-0 ~]$ oc get -n openshift istag | grep -i ubi8-openjdk-8:1.11 
      ~~~
      
      2. Example with resource secret
      
      ~~~ 
      [quickcluster@upi-0 ~]$ oc delete secrets/deployer-token-jz46t --dry-run=client
      secret "deployer-token-jz46t" deleted (dry run)
      
      [quickcluster@upi-0 ~]$ oc get secret | grep -i deployer-token-jz46t
      deployer-token-jz46t       kubernetes.io/service-account-token   4      28d
      
      [quickcluster@upi-0 ~]$ oc delete secrets/deployer-token-jz46t --dry-run=server
      secret "deployer-token-jz46t" deleted (server dry run)
      
      [quickcluster@upi-0 ~]$ oc get secret | grep -i deployer-token-jz46t
      deployer-token-jz46t       kubernetes.io/service-account-token   4      28d
      ~~~ 

      Actual results:

      For `istag` resource, whenever tried to delete the image with option `dry-run=server`. It actually got deleted from the server.

      Expected results:

      After deleting the `istag` using the `--dry-run=server` option with the server strategy, the `istag` object should still remain on the server.

      Additional info:

       

              aguclu@redhat.com Arda Guclu
              openshift-crt-jira-prow OpenShift Prow Bot
              None
              None
              Rahul Gangwar Rahul Gangwar
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: