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

Can't update referencePolicy when update imagestreamimport using oc create

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Undefined Undefined
    • None
    • 4.12.0
    • ImageStreams
    • None
    • Important
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      Can't update referencePolicy when update imagestreamimport

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

      4.12.0-0.ci.test-2022-09-09-005532-ci-ln-i59vkd2-latest

      How reproducible:

      always

      Steps to Reproduce:

      1.Create a imagestreamimport using oc create
      cat <<EOF | oc create -f -
      apiVersion: image.openshift.io/v1
      kind: ImageStreamImport
      metadata:
        name: dockerapp
      spec:
        import: true
        images:
        - from:
            kind: DockerImage
            name: quay.io/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f
          to:
            name: latest
          referencePolicy:
            type: Source
          importPolicy:
            importMode: "ManifestList"
      EOF
      imagestreamimport.image.openshift.io/dockerapp created
      2.Check the imagestreamtag details
      oc get is dockerapp -o yaml
      3.Update the referencePolicy to Local, and importMode to SingleManifest 
      cat <<EOF | oc create -f -
      apiVersion: image.openshift.io/v1
      kind: ImageStreamImport
      metadata:
        name: dockerapp
      spec:
        import: true
        images:
        - from:
            kind: DockerImage
            name: quay.io/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f
          to:
            name: latest
          referencePolicy:
            type: Local
          importPolicy:
            importMode: "SingleManifest"
      EOF
      imagestreamimport.image.openshift.io/dockerapp created
      4. check the imagestream details again

      Actual results:

      step 4 , importMode is updated to SingleManifest, but referencePolicy is not update to the expect "Local"
      
      $oc get is dockerapp -o yaml
      apiVersion: image.openshift.io/v1
      kind: ImageStream
      metadata:
        annotations:
          openshift.io/image.dockerRepositoryCheck: "2022-09-09T03:40:00Z"
        creationTimestamp: "2022-09-09T03:38:36Z"
        generation: 2
        name: dockerapp
        namespace: xiuwang
        resourceVersion: "77433"
        uid: 0a7bb4ee-e820-448c-bdf7-a57222769968
      spec:
        lookupPolicy:
          local: false
        tags:
        - annotations: null
          from:
            kind: DockerImage
            name: quay.io/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f
          generation: 2
          importPolicy:
            importMode: SingleManifest
          name: latest
          referencePolicy:
            type: Source
      status:
        dockerImageRepository: image-registry.openshift-image-registry.svc:5000/xiuwang/dockerapp
        tags:
        - items:
          - created: "2022-09-09T03:40:00Z"
            dockerImageReference: quay.io/openshifttest/busybox@sha256:0415f56ccc05526f2af5a7ae8654baec97d4a614f24736e8eef41a4591f08019
            generation: 2
            image: sha256:0415f56ccc05526f2af5a7ae8654baec97d4a614f24736e8eef41a4591f08019
          - created: "2022-09-09T03:38:36Z"
            dockerImageReference: quay.io/openshifttest/busybox@sha256:c5439d7db88ab5423999530349d327b04279ad3161d7596d2126dfb5b02bfd1f
            generation: 1
            image: sh

      Expected results:

      referencePolicy should be updated

      Additional info:

       

              fmissi Flavian Missi
              rh-ee-xiuwang XiuJuan Wang
              XiuJuan Wang XiuJuan Wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: