Bug 1381833 - issue with multi-container pods and triggers[].imageChangeParams.containerNames[]
Summary: issue with multi-container pods and triggers[].imageChangeParams.containerNam...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: openshift-controller-manager
Version: 3.3.0
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Michail Kargakis
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-05 07:35 UTC by Guillaume Coré
Modified: 2017-03-08 18:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A deployment config with multiple containers using the same ImageChangeTrigger wouldn't be updated by the image change controller. After https://github.com/openshift/origin/pull/9349 we redesigned the triggering mechanism and got rid of the image change controller. This bug was fixed as part of that work.
Clone Of:
Environment:
Last Closed: 2017-01-18 12:41:57 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 17:23:26 UTC

Description Guillaume Coré 2016-10-05 07:35:45 UTC
Description of problem:

When the DeploymentConfig has multi-container pods, the image is not updated after the build is finished. 

Version-Release number of selected component (if applicable):
$ oc version
oc v3.3.0.30
kubernetes v1.3.0+52492b4
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://master.manage.bm.chmouel.com:8443
openshift v3.3.0.30
kubernetes v1.3.0+52492b4

How reproducible:
everytime

Steps to Reproduce:
oc new-project test-multicontainer
oc new-app
centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git -o yaml
> 1.yaml

vim 1.yaml

# add a new container to the pod :

       containers:
        - image: ruby-ex:latest
          name: ruby-ex
          ports:
          - containerPort: 8080
            protocol: TCP
          resources: {}
        - image: ruby-ex:latest
          name: ruby-ex2
          ports:
          - containerPort: 8081
            protocol: TCP
          resources: {}

# and also add ruby-ex2 to  containerNames:

    triggers:
    - type: ConfigChange
    - imageChangeParams:
        automatic: true
        containerNames:
        - ruby-ex
        - ruby-ex2


Complete file after modification :
https://gist.github.com/fridim/92e6a0e8039e68ad6fad3d66f1d8419a


oc create -f 1.yaml

The deployment fails :

$ oc get pods
NAME               READY     STATUS      RESTARTS   AGE
ruby-ex-1-build    0/1       Completed   0          15m
ruby-ex-1-deploy   0/1       Error       0          13m


Actual results:
whole dc after build is finished: https://gist.github.com/fridim/aa3491eac28ee0ad7c4fd3b87da10641

Expected results:
both image for containers should be updated with something like :
        - image:
172.30.87.209:5000/test-multicontainer/ruby-ex@sha256:9fb754049d4f97df32572baccddcbfa34fecbcc559efa7bf16441e4437acb25a


Additional info:
WORKAROUND:
 Create one triggers[].imageChangeParams  by container with only one
name in containerNames[]  then it's OK
example: this one works:
https://gist.github.com/fridim/f11357de190ec969cdb7eb41d95341b0

DC shows image updated for both containers:
https://gist.github.com/fridim/d3c0caa0b6b8b20dd6029d8d4a3faa5e

Comment 1 Michail Kargakis 2016-10-05 11:18:54 UTC
This should be fixed in master already by https://github.com/openshift/origin/pull/9349. I am adding a test to verify the fix in https://github.com/openshift/origin/pull/11221

Comment 4 zhou ying 2016-10-18 02:14:51 UTC
 Michail Kargakis :
 Thanks, my DC is wrong, now the issue has fixed:
openshift version
openshift v3.4.0.12
kubernetes v1.4.0+776c994
etcd 3.1.0-alpha.1

      containers:
      - command:
        - /bin/sleep
        - "100"
        image: 172.30.191.97:5000/testzy/ruby-ex@sha256:9983aefce7d3a1a687de4a3350a1d829a23457353a6d2a209ffa38a86785740e
        imagePullPolicy: Always
        name: ruby-ex
        ports:
        - containerPort: 8080
          protocol: TCP
        resources: {}
        terminationMessagePath: /dev/termination-log
      - command:
        - /bin/sleep
        - "100"
        image: 172.30.191.97:5000/testzy/ruby-ex@sha256:9983aefce7d3a1a687de4a3350a1d829a23457353a6d2a209ffa38a86785740e
        imagePullPolicy: Always
        name: ruby-ex2
        ports:
        - containerPort: 8081
          protocol: TCP
        resources: {}
        terminationMessagePath: /dev/termination-log

Comment 6 errata-xmlrpc 2017-01-18 12:41:57 UTC
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-2017:0066


Note You need to log in before you can comment on or make changes to this bug.