Skip to content

Compare additionally generation when comparing ImageStreamTag status with spec - #10708

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
soltysh:issue10402
Sep 1, 2016
Merged

openshift-bot merged 1 commit into
openshift:masterfrom
soltysh:issue10402

Conversation

@soltysh

@soltysh soltysh commented Aug 29, 2016

Copy link
Copy Markdown
Contributor

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

Comment thread pkg/image/api/helper.go Outdated
sameImage := previous.Image == next.Image
return !(sameRef && sameImage)
sameGeneration := previous.Generation == next.Generation
return !(sameRef && sameImage && sameGeneration)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See the Godoc on this method. If there's a reason why the generation is not compared, we need to handle that as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're suggesting to add a flag, or create additional method?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll add the parameter and make sure to cover all, or at least most of the paths with new tests.

@soltysh

soltysh commented Aug 30, 2016

Copy link
Copy Markdown
Contributor Author

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]

@soltysh

soltysh commented Aug 31, 2016

Copy link
Copy Markdown
Contributor Author

@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

@smarterclayton

Copy link
Copy Markdown
Contributor

The change looks good, if you get green I'll flag it for merge.

@mfojtik mfojtik added this to the 1.3.0 milestone Aug 31, 2016
Comment thread pkg/image/api/helper.go
return !(sameRef && sameImage)
}

func DifferentTagGeneration(stream *ImageStream, tag string) bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

need godoc

@mfojtik

mfojtik commented Aug 31, 2016

Copy link
Copy Markdown
Contributor

LGTM

please add godoc and @smarterclayton can tag it for merge

@soltysh

soltysh commented Aug 31, 2016

Copy link
Copy Markdown
Contributor Author

Tests are (were) green, addressed Michal comment about missing godoc. @smarterclayton this is good to merge in that case.

@smarterclayton

Copy link
Copy Markdown
Contributor

[merge]

@openshift-bot

openshift-bot commented Aug 31, 2016 •

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge Waiting: You are in the build queue at position: 1

@smarterclayton

Copy link
Copy Markdown
Contributor

[test]

@soltysh

soltysh commented Sep 1, 2016

Copy link
Copy Markdown
Contributor Author

There are a few errors, but it all looks like caused by devicemapper error flake from #9548.

[test]

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to b8f6a2c

@openshift-bot

Copy link
Copy Markdown
Contributor

@liggitt liggitt added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 1, 2016
@smarterclayton

Copy link
Copy Markdown
Contributor

[merge]

@openshift-bot
openshift-bot merged commit 5a46b7e into openshift:master Sep 1, 2016
@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to b8f6a2c

@soltysh
soltysh deleted the issue10402 branch September 2, 2016 08:05
@bparees bparees mentioned this pull request Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants