Repository navigation
Compare additionally generation when comparing ImageStreamTag status with spec - #10708
Conversation
| sameImage := previous.Image == next.Image | ||
| return !(sameRef && sameImage) | ||
| sameGeneration := previous.Generation == next.Generation | ||
| return !(sameRef && sameImage && sameGeneration) |
There was a problem hiding this comment.
See the Godoc on this method. If there's a reason why the generation is not compared, we need to handle that as well.
There was a problem hiding this comment.
You're suggesting to add a flag, or create additional method?
There was a problem hiding this comment.
Not sure - there was a reason not to mutate the generation, so knowing which callers depended on it and which use cases would help clarify. I'm scared there aren't enough tests to be sure.
There was a problem hiding this comment.
I'll add the parameter and make sure to cover all, or at least most of the paths with new tests.
|
Since there's only call of that method I'd like to see how the tests are working. In the mean time I'm adding more unit tests. [test] |
|
@smarterclayton I've updated the patch to compare generations between status and spec not from an tagevent which is meant to be the feature tag and added a bit of tests. ptal |
|
The change looks good, if you get green I'll flag it for merge. |
| return !(sameRef && sameImage) | ||
| } | ||
|
|
||
| func DifferentTagGeneration(stream *ImageStream, tag string) bool { |
|
LGTM please add godoc and @smarterclayton can tag it for merge |
|
Tests are (were) green, addressed Michal comment about missing godoc. @smarterclayton this is good to merge in that case. |
|
[merge] |
|
continuous-integration/openshift-jenkins/merge Waiting: You are in the build queue at position: 1 |
|
[test] |
|
There are a few errors, but it all looks like caused by devicemapper error flake from #9548. [test] |
|
Evaluated for origin test up to b8f6a2c |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8620/) |
|
[merge] |
|
Evaluated for origin merge up to b8f6a2c |
Fixes #10402.
The root cause in the linked issue was that there is no actual change in image ID or it's reference and thus this change was not caught when comparing. I've added comparing generation in that code, as well.
@smarterclayton ptal
@mfojtik fyi