When trying to trigger based on a v1 StatefulSet, this message is printed to the logs and no trigger occurs: I0504 18:07:01.962652 1 image_trigger_controller.go:332] Error syncing resource statefulsets.apps/clayton-ci-search/search: unrecognized object - no trigger update possible for *v1.StatefulSet Will be backported.
@adam I am not sure my steps are correct to verify the bug, could you help to check, thanks. Steps: 1. Create pod with the following file: apiVersion: apps/v1 kind: StatefulSet metadata: name: testapp spec: selector: matchLabels: app: testapp replicas: 1 template: metadata: labels: app: testapp spec: containers: - name: testapp image: centos/ruby-25-centos7:latest command: - /bin/sleep args: - infinity 2. Check the pod is running 3. Change containers image like "centos/ruby-26-centos7:latest" , then statefulset rollout and pods is running again.
Recreator is a stateful set with a trigger: kind: ImageStream apiVersion: image.openshift.io/v1 metadata: name: ci-search namespace: ci-search spec: lookupPolicy: local: true tags: - name: latest importPolicy: scheduled: true from: kind: DockerImage name: registry.svc.ci.openshift.org/ci/ci-search:latest When the ci-search tag is updated (manually or scheduled) then the following stateful set should roll out kind: StatefulSet apiVersion: apps/v1 metadata: name: search namespace: ci-search annotations: image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"ci-search:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"web\")].image"}]' spec: selector: matchLabels: app: search template: metadata: labels: app: search spec: automountServiceAccountToken: false volumes: - name: bugzilla-token secret: secretName: bugzilla-credentials-bugzilla.redhat.com containers: - name: web image: ci-search:latest resources: requests: cpu: 100m memory: 1Gi volumeMounts: - name: bugzilla-token mountPath: /etc/bugzilla/ - mountPath: /var/lib/ci-search/ name: search command: - /usr/bin/search
Thanks so much @Clayton Coleman, According your ci-search example, be convenient for QE to auto cases, so I verified the bug with follow steps Version: 4.5.0-0.nightly-2020-05-08-200452 Steps: 1. $oc create -f statefulset-trigger.yaml 2. $oc get statefulset/testtrigger -o jsonpath={.metadata.generation} 2 3. $ oc tag centos/ruby-25-centos7 rubytest:latest [wewang@wangwen ~]$ oc get pods -w NAME READY STATUS RESTARTS AGE testtrigger-0 1/1 Terminating 0 2m35s testtrigger-0 0/1 Terminating 0 3m4s testtrigger-0 0/1 Terminating 0 3m5s testtrigger-0 0/1 Terminating 0 3m5s testtrigger-0 0/1 Pending 0 0s testtrigger-0 0/1 Pending 0 0s testtrigger-0 0/1 ContainerCreating 0 0s testtrigger-0 0/1 ContainerCreating 0 2s testtrigger-0 0/1 ContainerCreating 0 11s testtrigger-0 1/1 Running 0 22s 4. oc get statefulset/testtrigger -o jsonpath={.metadata.generation} 3 ``` [wewang@wangwen ~]$ cat statefulset-trigger.yaml apiVersion: v1 kind: List items: - apiVersion: image.openshift.io/v1 kind: ImageStream metadata: name: rubytest spec: lookupPolicy: local: true tags: - name: latest importPolicy: scheduled: true from: kind: DockerImage name: quay.io/openshifttest/ruby-25-centos7 - apiVersion: apps/v1 kind: StatefulSet metadata: name: testtrigger annotations: image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"rubytest:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"testtrigger\")].image"}]' spec: selector: matchLabels: app: testtrigger replicas: 1 template: metadata: labels: app: testtrigger spec: containers: - name: testtrigger image: rubytest:latest command: - /bin/sleep args: - infinity ```
Thanks so much @Clayton Coleman, According your ci-search example, be convenient for QE to auto cases, so I verified the bug with follow steps Version: 4.5.0-0.nightly-2020-05-08-200452 Steps: 1. $oc create -f statefulset-trigger.yaml 2. $oc get statefulset/testtrigger -o jsonpath={.metadata.generation} 2 3. $ oc tag centos/ruby-25-centos7 rubytest:latest [wewang@wangwen ~]$ oc get pods -w NAME READY STATUS RESTARTS AGE testtrigger-0 1/1 Terminating 0 2m35s testtrigger-0 0/1 Pending 0 0s testtrigger-0 0/1 ContainerCreating 0 0s testtrigger-0 1/1 Running 0 22s 4. oc get statefulset/testtrigger -o jsonpath={.metadata.generation} 3 ``` [wewang@wangwen ~]$ cat statefulset-trigger.yaml apiVersion: v1 kind: List items: - apiVersion: image.openshift.io/v1 kind: ImageStream metadata: name: rubytest spec: lookupPolicy: local: true tags: - name: latest importPolicy: scheduled: true from: kind: DockerImage name: quay.io/openshifttest/ruby-25-centos7 - apiVersion: apps/v1 kind: StatefulSet metadata: name: testtrigger annotations: image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"rubytest:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"testtrigger\")].image"}]' spec: selector: matchLabels: app: testtrigger replicas: 1 template: metadata: labels: app: testtrigger spec: containers: - name: testtrigger image: rubytest:latest command: - /bin/sleep args: - infinity ```
Oh, because of network, I clicked submit twice.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2409