Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy: allow to trigger deployment when ICT is updated #13886

Merged
merged 1 commit into from May 2, 2017

Conversation

mfojtik
Copy link
Member

@mfojtik mfojtik commented Apr 25, 2017

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1444545

Basically detect if there are any new triggers in the current DC (comparing to previous version). If yes, then don't prevent the controller from triggering.

@mfojtik
Copy link
Member Author

mfojtik commented Apr 25, 2017

[test]

// comparison.
if config.Status.LatestVersion > 0 && !triggeredByDifferentImage(*t.ImageChangeParams, *decoded) {
// comparison. Also configs with new/updated triggers should always trigger.
if config.Status.LatestVersion == 0 || hasUpdatedTriggers(*config, *decoded) || triggeredByDifferentImage(*t.ImageChangeParams, *decoded) {
Copy link
Member Author

@mfojtik mfojtik Apr 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kargakis this logic need check, it makes my brain hurt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine

@mfojtik mfojtik requested a review from 0xmichalis April 25, 2017 15:33
@mfojtik
Copy link
Member Author

mfojtik commented Apr 25, 2017

@Kargakis I want to add extended test proving this works as expected.

@0xmichalis
Copy link
Contributor

I think we also need to make the generictrigger controller enqueue DCs when there is an update in the triggers of the DC.

@mfojtik
Copy link
Member Author

mfojtik commented Apr 26, 2017

@Kargakis +1

@mfojtik
Copy link
Member Author

mfojtik commented Apr 26, 2017

[test]

flake: #11114

@mfojtik
Copy link
Member Author

mfojtik commented Apr 26, 2017

@Kargakis added extended test to prove this works, PTAL

err = wait.PollImmediate(500*time.Millisecond, 10*time.Second, func() (bool, error) {
dc, err = oc.Client().DeploymentConfigs(oc.Namespace()).Get(name)
if err != nil {
return false, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log this error and return nil

o.Expect(err).NotTo(o.HaveOccurred())

expectLatestVersion := func(version int) {
dc, err := oc.Client().DeploymentConfigs(oc.Namespace()).Get(name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing error check

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

expectLatestVersion(1)

g.By("updating the image change trigger to point to test:v2 image")
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these?

@0xmichalis
Copy link
Contributor

I think we also need to make the generictrigger controller enqueue DCs when there is an update in the triggers of the DC.

Shouldn't we also fix this here?

@mfojtik
Copy link
Member Author

mfojtik commented Apr 26, 2017

Shouldn't we also fix this here?

will prefer separate PR to unblock customer first.

o.Expect(err).NotTo(o.HaveOccurred())
_, err = oc.Run("set").Args("triggers", "dc/"+name, "--from-image", "test:v2", "--auto", "-c", "test").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(waitForSyncedConfig(oc, name, deploymentRunTimeout)).NotTo(o.HaveOccurred())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should switch waitForSyncedConfig to accept a generation so you can pass the generation you get from the last set triggers update, for this to be strictly correct.

@0xmichalis
Copy link
Contributor

will prefer separate PR to unblock customer first.

In the test, you are using oc tag for triggering a new rollout. Is this the only expectance here or should we also trigger when the DC is updated (at the point of the DC update, we can start deploying) ?

@mfojtik
Copy link
Member Author

mfojtik commented Apr 26, 2017

@Kargakis i would say that you need a ConfigChange trigger to trigger when DC is updated?

@mfojtik
Copy link
Member Author

mfojtik commented Apr 26, 2017

@Kargakis fixed, thanks!

@mfojtik
Copy link
Member Author

mfojtik commented Apr 26, 2017

flake: #13650

@0xmichalis
Copy link
Contributor

LGTM for unblocking the customer, let's follow-up with fixing the case where the image already exists

@mfojtik
Copy link
Member Author

mfojtik commented Apr 26, 2017

[merge]

@mfojtik
Copy link
Member Author

mfojtik commented Apr 28, 2017

[merge]

@mfojtik
Copy link
Member Author

mfojtik commented Apr 28, 2017

dnf flake [test]

@mfojtik
Copy link
Member Author

mfojtik commented Apr 28, 2017

[test] dnf flake again

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to ca25116

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1033/) (Base Commit: cd4661d)

@brenton
Copy link
Contributor

brenton commented May 1, 2017

flake: #13942

@brenton
Copy link
Contributor

brenton commented May 1, 2017

[merge]

@brenton
Copy link
Contributor

brenton commented May 1, 2017

flake: #13943

@0xmichalis
Copy link
Contributor

[merge]

@0xmichalis
Copy link
Contributor

@mfojtik did you create any issue for the follow-up work?

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to ca25116

@openshift-bot
Copy link
Contributor

openshift-bot commented May 1, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/530/) (Base Commit: df6ad91) (Image: devenv-rhel7_6194)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants