You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever a base image (required) changes, the derived image (requiring) should be rebuilt, if there has been structural changes to the base image.
Actual behavior
When tryImportMissing is enabled with variant: AbbrevTreeSha this doesn't always happen, when it should.
Changes to base image directory will result in changes to the git tree sha, which then will generate a new tag for the base image and trigger a rebuild. The derived image directory, and git tree sha, will remain the same.
tryImportMissing will cause the derived image runner to lookup the remote digest based solely on the tag for the derived image, on this line and then populate the cache with it here.
Since the tag for derived image hasn't changed it will be an existing image, without the base image changes.
Next, lookupRemote is run here which will look for the same tag we previously passed on this line and compare it with the digest of itself here.
This is superfluous/wrong, because we are looking up the exact same image twice and comparing it against itself.
This results in a "found" image, which is then appended to the local cache, effectively poisoning it against any future changes to the base image, until the derived image directory changes.
This applies to gitCommit and inputDigest strategies as well, as it will retag an image, instead of rebuilding it.
I don't have a fix in mind for this as of yet, but would love to work on a PR to fix it, if I could get some help with it :)
Expected behavior
Whenever a base image (required) changes, the derived image (requiring) should be rebuilt, if there has been structural changes to the base image.
Actual behavior
When
tryImportMissing
is enabled withvariant: AbbrevTreeSha
this doesn't always happen, when it should.Changes to base image directory will result in changes to the git tree sha, which then will generate a new tag for the base image and trigger a rebuild. The derived image directory, and git tree sha, will remain the same.
tryImportMissing
will cause the derived image runner to lookup the remote digest based solely on the tag for the derived image, on this line and then populate the cache with it here.Since the
tag
for derived image hasn't changed it will be an existing image, without the base image changes.Next,
lookupRemote
is run here which will look for the same tag we previously passed on this line and compare it with the digest of itself here.This is superfluous/wrong, because we are looking up the exact same image twice and comparing it against itself.
This results in a "found" image, which is then appended to the local cache, effectively poisoning it against any future changes to the base image, until the derived image directory changes.
This applies to
gitCommit
andinputDigest
strategies as well, as it will retag an image, instead of rebuilding it.I don't have a fix in mind for this as of yet, but would love to work on a PR to fix it, if I could get some help with it :)
Information
v2.12.0
Steps to reproduce the behavior
skaffold build --default-repo=<some-registry>
RUN
step to the Dockerfileskaffold build --default-repo=<some-registry>
ubuntu:latest
instead ofalpine
skaffold build --default-repo=<some-registry>
Derived image won't be rebuilt, but base image will.
Clearing the cache and then setting
tryImportMissing: false
will "fix" it.The text was updated successfully, but these errors were encountered: