-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
apps: Fix dc triggers reconciliation on image change and do not deploy DCs with empty image #17539
apps: Fix dc triggers reconciliation on image change and do not deploy DCs with empty image #17539
Conversation
|
||
// Never deploy with invalid or unresolved images | ||
for i, container := range config.Spec.Template.Spec.Containers { | ||
if strings.TrimSpace(container.Image) == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought we guard against this in shouldTrigger()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't, we wait for the RC to be created and because the image resolution/injection is happening asynchronously it will manage to deploy RC with "" before the image gets injected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried fixing the image in that function but then it will end up being triggered as config change. we could probably add exception for that as well but this felt cleanest and most reliable. We should do the same upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be better to move this up to triggerActivated
and just return false, true ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it could be there now that shouldSkip is honored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfojtik actually that wouldn't work for manual rollouts without any trigger, so needs to stay here
/retest |
Added a fix for DC image reactor. Tests are green and ready for review. |
/cherrypick release-3.8 |
@tnozicka: @tnozicka once the present PR merges, I will cherry-pick it on top of release-3.8 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherrypick release-3.7 |
@tnozicka: @tnozicka once the present PR merges, I will cherry-pick it on top of release-3.7 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
// We need to react on image changes as well. Image names could change, | ||
// images could be set to different value or resetted to "" e.g. by oc apply | ||
// and we need to make sure those changes get reconciled by re-resolving images | ||
case !reflect.DeepEqual(dc.Spec.Template.Spec.Containers, oldDC.Spec.Template.Spec.Containers): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be check only the images then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worst case this will be processed but not triggered, but I think we need some common helper like HasUpdatedImages() to work well for this and for other places. this is fine now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed on IRC but for the record: I don't see other way we can determine if it needs to be queued without actually doing all the work in UpdateDeploymentConfigImages. This is just a check for adding to work queue, it should be fast and simple. After picking it up from queue we already do all the checks for updated images and others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when I want to run my own image for sometime and not the image resolved by the trigger? Can I do that now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kargakis set automatic
to false
if it's active the state should always be reconciled
one last question, looks good to me otherwise |
/lgtm |
/retest |
1 similar comment
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
github down on clone |
/retest |
1 similar comment
/retest |
f782a9b
to
0e45ee9
Compare
no changes, just squashed the commit with additional log message for tests /hold cancel |
/retest |
infra issues |
0e45ee9
to
94e0120
Compare
return c.updateStatus(config, existingDeployments) | ||
// Never deploy with invalid or unresolved images | ||
for i, container := range config.Spec.Template.Spec.Containers { | ||
if strings.TrimSpace(container.Image) == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len() :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, hopefully for good now ;)
94e0120
to
cda584a
Compare
CI cluster network issues |
flake: #17882 |
@mfojtik len() is there, tests are green - lgty? |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mfojtik, tnozicka The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
@tnozicka: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 17539, 17457). |
@tnozicka: cannot checkout release-3.8 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherrypick release-3.8 |
@tnozicka: #17539 failed to apply on top of branch "release-3.8":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes: #17404
Fixes: #17535
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1515902
/cc @mfojtik