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

LimitRange should not prevent deleting ImageTag

XMLWordPrintable

    • Moderate
    • No
    • False
    • Hide

      None

      Show
      None
    • Allow deleting ImageStream ImageTags that are violating LimitRange constraints.
    • Bug Fix
    • In Progress

      Description of problem:

      LimitRange prevent deleting ImageTag if the number of the ImageTag after deletion is still above the configured maximum limit.

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

      4.14

      How reproducible:

      Always

      Steps to Reproduce:

      $ oc new-project test
      $ oc new-app http://github.com/nekop/hello-sinatra
      $ oc patch bc/hello-sinatra -p '{"spec": {"output": {"to": {"name": "hello-sinatra:v1"}}}}'
      $ oc start-build hello-sinatra
      $ oc patch bc/hello-sinatra -p '{"spec": {"output": {"to": {"name": "hello-sinatra:v2"}}}}'
      $ oc start-build hello-sinatra
      $ oc patch bc/hello-sinatra -p '{"spec": {"output": {"to": {"name": "hello-sinatra:v3"}}}}'
      $ oc start-build hello-sinatra
      $ oc patch bc/hello-sinatra -p '{"spec": {"output": {"to": {"name": "hello-sinatra:v4"}}}}'
      $ oc start-build hello-sinatra
      $ oc get is
      NAME            IMAGE REPOSITORY                                                      TAGS                 UPDATED
      hello-sinatra   image-registry.openshift-image-registry.svc:5000/test/hello-sinatra   v4,v3,v2,v1,latest   22 seconds ago
      $ oc get istag
      NAME                   IMAGE REFERENCE                                                                                                                               UPDATED
      hello-sinatra:v1       image-registry.openshift-image-registry.svc:5000/test/hello-sinatra@sha256:1c37bea2b248365fd01eadaa3ef7cb7cd5ae8e91b18d01163be50e17206d6dae   3 minutes ago
      hello-sinatra:v2       image-registry.openshift-image-registry.svc:5000/test/hello-sinatra@sha256:81c4313c8b9417177834b6f3dd292c56d321b8d834bde90a8103396caa4fcc31   2 minutes ago
      hello-sinatra:v3       image-registry.openshift-image-registry.svc:5000/test/hello-sinatra@sha256:84b5a94f95e52e5826a4916dce866bc5e86fb55d4783748014560de8255e7bc4   2 minutes ago
      hello-sinatra:v4       image-registry.openshift-image-registry.svc:5000/test/hello-sinatra@sha256:ef72970bb6be4bad75399ff72b744fa9dd8dd86bb0f4be597c83e90f4a03cee1   About a minute ago
      hello-sinatra:latest   image-registry.openshift-image-registry.svc:5000/test/hello-sinatra@sha256:1ac1ef3da31c6acf99422b26d89ef81b387675d637f47eeb37d62517e829f39f   12 minutes ago
      $ oc get imagetag
      NAME                   SPEC   STATUS                                                                          HISTORY   UPDATED
      hello-sinatra:latest   Push   image/sha256:1ac1ef3da31c6acf99422b26d89ef81b387675d637f47eeb37d62517e829f39f   1         12 minutes ago
      hello-sinatra:v1       Push   image/sha256:1c37bea2b248365fd01eadaa3ef7cb7cd5ae8e91b18d01163be50e17206d6dae   1         3 minutes ago
      hello-sinatra:v2       Push   image/sha256:81c4313c8b9417177834b6f3dd292c56d321b8d834bde90a8103396caa4fcc31   1         3 minutes ago
      hello-sinatra:v3       Push   image/sha256:84b5a94f95e52e5826a4916dce866bc5e86fb55d4783748014560de8255e7bc4   1         2 minutes ago
      hello-sinatra:v4       Push   image/sha256:ef72970bb6be4bad75399ff72b744fa9dd8dd86bb0f4be597c83e90f4a03cee1   1         About a minute ago
      $ cat limitrange.yaml
      apiVersion: "v1"
      kind: "LimitRange"
      metadata:
        name: "resource-limits"
      spec:
        limits:
          - type: openshift.io/ImageStream
            max:
              openshift.io/images: 3
      $ oc create -f limitrange.yaml
      limitrange/resource-limits created
      $ oc tag -d hello-sinatra:v4
      The ImageStream "hello-sinatra" is invalid: []: Internal error: ImageStream.image.openshift.io "hello-sinatra" is forbidden: requested usage of openshift.io/images exceeds the maximum limit per openshift.io/ImageStream (4 > 3)
      $ oc delete imagetag hello-sinatra:v4
      The ImageStream "hello-sinatra" is invalid: []: Internal error: ImageStream.image.openshift.io "hello-sinatra" is forbidden: requested usage of openshift.io/images exceeds the maximum limit per openshift.io/ImageStream (4 > 3)
      $ oc delete istag hello-sinatra:v4
      The ImageStream "hello-sinatra" is invalid: []: Internal error: ImageStream.image.openshift.io "hello-sinatra" is forbidden: requested usage of openshift.io/images exceeds the maximum limit per openshift.io/ImageStream (4 > 3) 

      Actual results:

      The ImageTag cannot be deleted.

      Expected results:

      The ImageTag can be deleted.

      Additional info:

       

              fkrepins@redhat.com Filip Krepinsky
              rhn-support-yhe Yiyong He
              Ying Zhou Ying Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: