-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Persistent volume caching for base images #383
Merged
sharifelgamal
merged 21 commits into
GoogleContainerTools:master
from
sharifelgamal:caching
Oct 11, 2018
Merged
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
fcfc2f4
comments
sharifelgamal 4db3991
Merge branch 'master' of github.com:GoogleCloudPlatform/kaniko into c…
sharifelgamal f12eadc
Merge branch 'master' of github.com:GoogleCloudPlatform/kaniko into c…
sharifelgamal e915460
Merge branch 'master' of github.com:GoogleCloudPlatform/kaniko into c…
sharifelgamal 8dd6d47
initial commit for persisent volume caching
sharifelgamal fc1d3e1
Merge branch 'master' of github.com:GoogleCloudPlatform/kaniko into c…
sharifelgamal 979092e
cache warmer works
sharifelgamal 1667b39
Merge branch 'master' of github.com:GoogleCloudPlatform/kaniko into c…
sharifelgamal ad4f604
general cleanup
sharifelgamal 69a760e
adding some debugging
sharifelgamal c44bd34
adding missing files
sharifelgamal 123d5f3
Fixing up cache retrieval and cleanup
sharifelgamal 88c6945
Merge branch 'master' of github.com:GoogleCloudPlatform/kaniko into c…
sharifelgamal 72e71ce
fix tests
sharifelgamal 78c2111
removing auth since we only cache public images
sharifelgamal b8ac1be
simplifying the caching logic
sharifelgamal 27888f3
fixing logic
sharifelgamal d158f70
adding volume cache to integration tests. remove auth from cache warm…
sharifelgamal 0a550f0
add building warmer to integration-test
sharifelgamal 47c8ff4
move sample yaml files to examples dir
sharifelgamal 78d4898
small test fix
sharifelgamal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ limitations under the License. | |
package util | ||
|
||
import ( | ||
"fmt" | ||
"path/filepath" | ||
"strconv" | ||
|
||
|
@@ -106,7 +105,22 @@ func cachedImage(opts *config.KanikoOptions, image string) (v1.Image, error) { | |
if err != nil { | ||
return nil, err | ||
} | ||
cacheKey := ref.Name() | ||
fmt.Printf("CACHEKEY=%s", cacheKey) | ||
return cache.LocalDestination(opts, cacheKey) | ||
|
||
k8sc, err := k8schain.NewNoClient() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there's an easier way to do this with no auth: https://github.com/google/go-containerregistry/blob/d54baf9aa28edb9b985a6b35b57e26e3410c2443/pkg/authn/anon.go |
||
if err != nil { | ||
return nil, err | ||
} | ||
kc := authn.NewMultiKeychain(authn.DefaultKeychain, k8sc) | ||
|
||
img, err := remote.Image(ref, remote.WithAuthFromKeychain(kc)) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
cacheKey, err := img.Digest() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return cache.LocalSource(opts, cacheKey.String(), image) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, should we use a normal keychain if we're not on k8s?