Bug 1444545 - ImageChange Trigger not triggering new deploy pods after a successful build
Summary: ImageChange Trigger not triggering new deploy pods after a successful build
Keywords:
Status: CLOSED EOL
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: openshift-controller-manager
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 3.7.z
Assignee: Michal Fojtik
QA Contact: zhou ying
URL:
Whiteboard:
: 1444544 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-22 05:18 UTC by Miheer Salunke
Modified: 2020-06-11 13:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-23 13:06:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
reproducer script (1.47 KB, application/x-shellscript)
2017-04-22 05:19 UTC, Miheer Salunke
no flags Details

Description Miheer Salunke 2017-04-22 05:18:55 UTC
Description of problem:

During my testing, I discovered that the container image and "lastTriggeredImage" are updating to the latest image after each successful build, even though a deployment isn't being started.

Script to reproduce described behavior.


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

How reproducible:
Always

Steps to Reproduce:
1.run the attached script
2.
3.

Actual results:
ImageChange Trigger not triggering new deploy pods after a successful build

Expected results:

ImageChange Trigger shall trigger deployment of new pods after a successful build

Additional info:

Comment 1 Miheer Salunke 2017-04-22 05:19:52 UTC
Created attachment 1273368 [details]
reproducer script

Comment 2 Garrett Hyde 2017-04-22 05:48:43 UTC
For clarification, the container image and "lastTriggeredImage" is being updated it the DeploymentConfig, and "imageChangeParams.automatic" remains true. However, a deployment isn't started after an image change.

After `oc deploy myapp --latest` is manually executed, the trigger starts working again.

Comment 5 Michal Fojtik 2017-04-24 14:41:08 UTC
The problem seems to be the `oc patch` and the `oc set triggers` both strips the `lastTriggeredImage`. If you don't erase that field, the trigger will continue to work properly.

We are still investigating this as it seems like a bug in the controller.

Comment 6 Garrett Hyde 2017-04-24 14:55:02 UTC
`lastTriggeredImage` is still in the DeploymentConfig. It is even updated after an `oc start-build`, even though a new deployment isn't started.

`oc export` does not output `lastTriggeredImage`, but it can be view with `oc edit`.

Comment 7 Garrett Hyde 2017-04-24 15:01:33 UTC
*** Bug 1444544 has been marked as a duplicate of this bug. ***

Comment 8 Michal Fojtik 2017-04-25 09:39:21 UTC
(In reply to Garrett Hyde from comment #6)
> `lastTriggeredImage` is still in the DeploymentConfig. It is even updated
> after an `oc start-build`, even though a new deployment isn't started.
> 
> `oc export` does not output `lastTriggeredImage`, but it can be view with
> `oc edit`.

In what I observed, when the lastTriggeredImage is removed from the trigger, the trigger will stop working and you have to `oc rollout latest dc/foo` to make it work again (at least in the latest master of openshift)...

I assume the customer use 3.3, I will try to reproduce that there.

Comment 9 Michal Fojtik 2017-04-25 10:28:53 UTC
I can see that the reproducer script does not work against 3.3 cluter (the oc new-app will fail) so I assume this was reproduced against 3.5/3.6 ?

Comment 10 Garrett Hyde 2017-04-25 15:33:27 UTC
(In reply to Michal Fojtik from comment #9)
> I can see that the reproducer script does not work against 3.3 cluter (the
> oc new-app will fail) so I assume this was reproduced against 3.5/3.6 ?

I ran the reproducer script against a 3.3 cluster.

Comment 11 Michal Fojtik 2017-04-25 15:37:16 UTC
PR: https://github.com/openshift/origin/pull/13886

The problem is the lastTriggeredImage that we store in the previous RC does not match with the current DC version. In that case we stop the trigger because the images are different.

The PR should allow to replace the trigger with a different ICT (it will detect that DC has a new trigger defined) and allow the controller to rollout on the new image change.


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