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

fix(docker): Update cache when a null tag becomes non-null #344

Merged
merged 3 commits into from Jan 2, 2019

Conversation

Projects
None yet
3 participants
@ezimanyi
Copy link
Member

ezimanyi commented Dec 21, 2018

We currently don't update the docker image cache when either the prior or the current digest is null. This means that any tag that was present before trackDigests was enabled will always have its digest set to null. Change this so we do set the digest any time the new one is not null.

In order to avoid triggering multiple pipelines when turning trackDigests on, we won't send an event to echo when updating from a null to non-null digest (as we don't actually know if it was updated), we'll only update the cache.

ezimanyi added some commits Dec 21, 2018

test(docker): Add unit tests for shouldUpdateCache
Also lightly clean up some of the existing tests
refactor(docker): Change return type and name of shouldUpdateCache
To prepare to allow cache updates without sending events, change
the return type of shouldUpdateCache to an object, and also
change the name to getUpdateType.
fix(docker): Update cache when a null tag becomes non-null
We currently don't update the docker image cache when either
the prior or the current digest is null. This means that any
tag that was present before trackDigests was enabled will
always have its digest set to null. Change this so we do set
the digest any time the new one is not null.

In order to avoid triggering multiple pipelines when turning
trackDigests on, we won't send an event to echo when updating
from a null to non-null digest (as we don't actually know if
it was updated), we'll only update the cache.
@ezimanyi

This comment has been minimized.

Copy link
Member

ezimanyi commented Dec 21, 2018

@ezimanyi ezimanyi requested a review from lwander Jan 2, 2019

@lwander

lwander approved these changes Jan 2, 2019

boolean sendEvent = true
}

private static class UpdateType {

This comment has been minimized.

@lwander

@ezimanyi ezimanyi merged commit c001dea into spinnaker:master Jan 2, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ezimanyi ezimanyi deleted the ezimanyi:fix-track-digest branch Jan 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment