Bug 1538731
| Summary: | image.openshift.io/triggers for initContainers fails to replace image field | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Joseph Callen <jcallen> | ||||||||
| Component: | openshift-apiserver | Assignee: | Stefan Schimanski <sttts> | ||||||||
| Status: | CLOSED DEFERRED | QA Contact: | Wang Haoran <haowang> | ||||||||
| Severity: | low | Docs Contact: | |||||||||
| Priority: | low | ||||||||||
| Version: | 3.7.0 | CC: | aos-bugs, jcallen, jlieskov, jokerman, mfojtik, mmccomas, rromerom | ||||||||
| Target Milestone: | --- | ||||||||||
| Target Release: | 3.9.z | ||||||||||
| Hardware: | x86_64 | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2019-11-20 19:05:29 UTC | Type: | Bug | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Joseph Callen
2018-01-25 17:04:51 UTC
I tried to reproduce this but it seems like the `is/mariadb-galera:latest` is not imported properly. The tag does not exists and therefore the trigger will not replace the image field in initContainers.
I tried to manually force to import busybox:latest as mariadb-galera:latest and the trigger worked as expected:
$ oc tag --source docker busybox:latest mariadb-galera:latest # (This will just simulate that the tag is available)
$ oc get statefulset/mariadb-galera -o yaml | ack busybox
image: busybox@sha256:4cee1979ba0bf7db9fc5d28fb7b798ca69ae95a47c5fecf46327720df4ff352d
image: busybox@sha256:4cee1979ba0bf7db9fc5d28fb7b798ca69ae95a47c5fecf46327720df4ff352d
(this means the image was resolved properly).
Michal, The ImageStream `mariadb-galera` is a output location for the BuildConfig of the same name (templated). The only import is `docker.io/centos/mariadb-102-centos7:latest`. SUCCESS: I replaced the initContainer image string [0] with the URL of the image location. After the BuildConfig completes the init container and container starts and runs correctly. [1] Image trigger annotations for initContainers should work in v3.7 [2] right? FAILURE: Testing with v3.7 with undefined url in initContainer image. [3] SUCCESS: Testing with 'openshift v3.9.0-alpha.4+3dcad95-52' using 'oc cluster up'. Runs correctly not including the initContainer image URL.[4] Attached `oc get events` for each testing. [0] - https://github.com/jcpowermac/mariadb-ha-poc/blob/55ad8d2793c88e1ef1b194ffbf37dc5e8254243d/testing/init-defined.yml#L84 [1] - https://asciinema.org/a/160553 [2] - https://github.com/openshift/origin/blob/284b8b758829448a3a5fc9ba66506320becf1c94/pkg/image/trigger/annotations/annotations.go#L54 [3] - https://asciinema.org/a/160556 [4] - https://asciinema.org/a/160558 Created attachment 1389672 [details]
v37-with-initcontainer-spec-image-defined
Created attachment 1389674 [details]
v37-with-initcontainer-spec-image-undefined
Created attachment 1389675 [details]
v39-with-initcontainer-spec-image-undefined
I could reproduce it as well with Elasticsearch Statefulset. Having only one trigger for the container it works and populates the image value:
image.openshift.io/triggers: |
[{
"from": {
"kind": "ImageStreamTag",
"name": "elasticsearch:6.1.2"
},
"fieldPath": "spec.template.spec.containers[?(@.name==\"elasticsearch\")].image"
}]
...
containers:
- name: elasticsearch
image: ' '
After creating the StatefulSet:
image: 172.30.1.1:5000/ek-apb-002/elasticsearch@sha256:70629ad1d3976baca1d98ef377e0b03a73cc90648b0423fd4edd950b7d552b6d
As Joseph mentioned before, when having also the trigger for the initcontainer it complains about the image value being ' '.
OCP 3.6-3.10 is no longer on full support [1]. Marking CLOSED DEFERRED. If you have a customer case with a support exception or have reproduced on 3.11+, please reopen and include those details. When reopening, please set the Target Release to the appropriate version where needed. [1]: https://access.redhat.com/support/policy/updates/openshift OCP 3.6-3.10 is no longer on full support [1]. Marking CLOSED DEFERRED. If you have a customer case with a support exception or have reproduced on 3.11+, please reopen and include those details. When reopening, please set the Target Release to the appropriate version where needed. [1]: https://access.redhat.com/support/policy/updates/openshift |