Skip to content
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

Bumps imgutil to fix daemon image bugs #485

Merged
merged 1 commit into from
Dec 11, 2020
Merged

Bumps imgutil to fix daemon image bugs #485

merged 1 commit into from
Dec 11, 2020

Conversation

ekcasey
Copy link
Member

@ekcasey ekcasey commented Dec 10, 2020

Falls back to slower behavior if the daemon does not accept empty layers. This allows the lifecycle to be compatible with podman which requires all layers to be preset during a docker load: buildpacks/imgutil#80

Fixes "manifest.json had unexpected number of entries" errors in analyze, export, and rebase resulting from a bug in our daemon save logic: buildpacks/imgutil#63

Signed-off-by: Emily Casey ecasey@vmware.com

Falls back to slower behavior if the daemon does not accept empty layers. This allows the lifecycle to be compatible with podman which requires all layers to be preset during a docker load. buildpacks/imgutil#80

Fixes "manifest.json had unexpected number of entries"  errors in analyze, export, and rebase resulting from a bug in our daemon save logic buildpacks/imgutil#63

Signed-off-by: Emily Casey <ecasey@vmware.com>
@@ -259,6 +259,7 @@ func initDaemonImage(imagName string, runImageRef string, analyzedMD lifecycle.A
opts = append(opts, local.WithPreviousImage(analyzedMD.Image.Reference))
}

var appImage imgutil.Image
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes because local.NewImage now returns a *local.Image instead of an imgutil.Image type. Without this, https://github.com/buildpacks/lifecycle/pull/485/files#diff-92c6ed289675df1e2edf598694dfc99f22a591496c130d10a43e86830cbd3686R282, fails because cache.NewCachingImage returns an imgutil.Image type and you can change the type of the variable without redeclaring it. However, since *local.Image implements imgutil.Image if you just declare the variable with the interface type everything works fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is very confusing but it looks like this is the way Golang works (because an interface is a pointer to itself).
Thanks for the clarification @ekcasey!

@ekcasey ekcasey added this to the lifecycle-0.10.0 milestone Dec 10, 2020
@ekcasey ekcasey added the type/bug Something isn't working label Dec 10, 2020
@ekcasey ekcasey merged commit f77cc9b into main Dec 11, 2020
@ekcasey ekcasey deleted the bugfix/daemon-image branch December 11, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants