-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
4.16.z
-
None
-
False
-
-
Description of problem:
On the OCP 4.16.10, when creating a pod from ImageStram, we observed some strange behaviour with the Tag names of the Images output by "oc get pod ose-cli-pod-test -o yaml". Should we assume that the image being used is correct, even though it is being output Tag incorrectly?
Version-Release number of selected component (if applicable):
4.16.10
How reproducible:
### preparing some files $ oc new-project test-ns $ cat is-v1.yaml apiVersion: image.openshift.io/v1 kind: ImageStream metadata: name: osecli-local-test namespace: test-ns spec: tags: - name: v1 from: kind: DockerImage name: registry.redhat.io/openshift4/ose-cli@sha256:d979bc3198c389f82a05b468296155da2392d91cb03f30038c4fe789d1b044e6 $ diff is-v1.yaml is-v2.yaml 8c8 < - name: v1 --- > - name: v2 $ cat pod-v1.yaml apiVersion: v1 kind: Pod metadata: name: ose-cli-pod-test namespace: test-ns spec: containers: - name: ose-cli-container image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v1 imagePullPolicy: Always command: ["/bin/bash", "-c", "--"] args: ["while true; do sleep 30; done;"] $ diff pod-v[12].yaml 9c9 < image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v1 --- > image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v2 ### Here's the first test using "v1" image $ oc get is No resources found in test-ns namespace. $ oc get pod No resources found in test-ns namespace. $ oc apply -f is-v1.yaml imagestream.image.openshift.io/osecli-local-test created $ oc get is NAME IMAGE REPOSITORY TAGS UPDATED osecli-local-test image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test v1 2 minutes ago $ oc apply -f pod-v1.yaml pod/ose-cli-pod-test created $ oc get pod NAME READY STATUS RESTARTS AGE ose-cli-pod-test 1/1 Running 0 4s ### In this case, "oc get pod ose-cli-pod-test -o yaml" outputs the same tag between ImageStream("v1") and "containerStatuses" ("v1") $ oc get pod ose-cli-pod-test -o yaml | grep -B2 image: - -c - -- image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v1 <<<<< "v1" -- containerStatuses: - containerID: cri-o://ac73478ab8b6208759a524e7b7aa59383700c5315592f4e066c0f92714d1742a image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v1 <<<<< "v1" ============================================================================== ### Here's the next test using "v2" image $ oc delete pod ose-cli-pod-test pod "ose-cli-pod-test" deleted $ oc delete is osecli-local-test imagestream.image.openshift.io "osecli-local-test" deleted $ oc get is No resources found in test-ns namespace. $ oc get pod No resources found in test-ns namespace. $ oc apply -f is-v2.yaml imagestream.image.openshift.io/osecli-local-test created $ oc get is NAME IMAGE REPOSITORY TAGS UPDATED osecli-local-test image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test v2 4 seconds ago $ oc apply -f pod-v2.yaml pod/ose-cli-pod-test created $ oc get pod NAME READY STATUS RESTARTS AGE ose-cli-pod-test 1/1 Running 0 5s ### In this case, "oc get pod ose-cli-pod-test -o yaml" outputs the same tag between ImageStream("v2") and "containerStatuses" ("v2") $ oc get pod ose-cli-pod-test -o yaml | grep -B2 image: - -c - -- image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v2 <<<<< "v2" -- containerStatuses: - containerID: cri-o://4a4a0ff8e41c4ede9cf5fc76c90e9161b7370c644b419c14eb0c3ea17d55a8f8 image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v2 <<<<<< "v2" ============================================================================== ### Here's the final test using "v1" image again $ oc delete pod ose-cli-pod-test pod "ose-cli-pod-test" deleted $ oc delete is osecli-local-test imagestream.image.openshift.io "osecli-local-test" deleted $ oc get pod No resources found in test-ns namespace. $ oc get is No resources found in test-ns namespace. $ oc apply -f is-v1.yaml imagestream.image.openshift.io/osecli-local-test created $ oc get is NAME IMAGE REPOSITORY TAGS UPDATED osecli-local-test image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test v1 1 second ago $ oc apply -f pod-v1.yaml pod/ose-cli-pod-test created $ oc get pod NAME READY STATUS RESTARTS AGE ose-cli-pod-test 1/1 Running 0 4s ### In this case, "oc get pod ose-cli-pod-test -o yaml" outputs the different tag between ImageStream("v1") and "containerStatuses" ("v2") $ oc get pod ose-cli-pod-test -o yaml | grep -B2 image: - -c - -- image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v1 <<<<< "v1" -- containerStatuses: - containerID: cri-o://18c8ca089b5e918f464fc148cdbaee5836abfd9eca5274096d2ff72a02d61ba3 image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v2 <<<<< "v2" $ oc get is NAME IMAGE REPOSITORY TAGS UPDATED osecli-local-test image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test v1 26 seconds ago $
Actual results:
containerStatuses: - containerID: cri-o://18c8ca089b5e918f464fc148cdbaee5836abfd9eca5274096d2ff72a02d61ba3 image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v2 <<<<< "v2"
Expected results:
containerStatuses: - containerID: cri-o://ac73478ab8b6208759a524e7b7aa59383700c5315592f4e066c0f92714d1742a image: image-registry.openshift-image-registry.svc:5000/test-ns/osecli-local-test:v1 <<<<< "v1"
Additional info: