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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/lifecycle/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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!

appImage, err := local.NewImage(
imagName,
docker,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect
github.com/apex/log v1.9.0
github.com/buildpacks/imgutil v0.0.0-20201201142712-a6b11a745ca6
github.com/buildpacks/imgutil v0.0.0-20201209143029-339e186e495a
github.com/containerd/containerd v1.3.3 // indirect
github.com/docker/cli v0.0.0-20200312141509-ef2f64abbd37 // indirect
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ github.com/buildpacks/imgutil v0.0.0-20201022190551-6525b8cdcdd0 h1:NfMkYsjGmNJG
github.com/buildpacks/imgutil v0.0.0-20201022190551-6525b8cdcdd0/go.mod h1:tG2oQSjijSLsymHJz/K3dJyUfmQ72dBfxDqWlNMPFUQ=
github.com/buildpacks/imgutil v0.0.0-20201201142712-a6b11a745ca6 h1:rV6HuGwGHYnqwcDdR1yhC5Ksmq7axwFwnwEv7B00Pag=
github.com/buildpacks/imgutil v0.0.0-20201201142712-a6b11a745ca6/go.mod h1:jrlRd+Htv2BB3l5ri0TBj49Nk5NuakkOe6Nx4+EUjYM=
github.com/buildpacks/imgutil v0.0.0-20201209143029-339e186e495a h1:XGfPOtXJL8izPAA+Vixbl1BeTG5Pe1evubfOdxDAmpM=
github.com/buildpacks/imgutil v0.0.0-20201209143029-339e186e495a/go.mod h1:NC93OGDehA2ksqgTzugeQcPqmTpilMPYRO+XaFsDyts=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down
2 changes: 1 addition & 1 deletion tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.15

require (
github.com/BurntSushi/toml v0.3.1
github.com/buildpacks/imgutil v0.0.0-20201201142712-a6b11a745ca6
github.com/buildpacks/imgutil v0.0.0-20201209143029-339e186e495a
github.com/buildpacks/lifecycle v0.9.2
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7
github.com/golang/mock v1.4.4
Expand Down
1 change: 1 addition & 0 deletions tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2
github.com/buildpacks/imgutil v0.0.0-20201022190551-6525b8cdcdd0 h1:NfMkYsjGmNJGl80WHEa4rGM1hU8IDUIdqBiPZpxkvRM=
github.com/buildpacks/imgutil v0.0.0-20201022190551-6525b8cdcdd0/go.mod h1:tG2oQSjijSLsymHJz/K3dJyUfmQ72dBfxDqWlNMPFUQ=
github.com/buildpacks/imgutil v0.0.0-20201201142712-a6b11a745ca6/go.mod h1:jrlRd+Htv2BB3l5ri0TBj49Nk5NuakkOe6Nx4+EUjYM=
github.com/buildpacks/imgutil v0.0.0-20201209143029-339e186e495a/go.mod h1:NC93OGDehA2ksqgTzugeQcPqmTpilMPYRO+XaFsDyts=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down