-
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
Provide --cache-repo
as OCI image layout path
#2250
Provide --cache-repo
as OCI image layout path
#2250
Conversation
- Adds cache.LayoutCache to implement cache.LayerCache interface - When opts.CacheRepo has "oci:" prefix, instantiates a LayoutCache Signed-off-by: Natalie Arellano <[email protected]>
Signed-off-by: Natalie Arellano <[email protected]>
imageRepo, serviceAccount := config.imageRepo, config.serviceAccount | ||
_, ex, _, _ := runtime.Caller(0) | ||
cwd := filepath.Dir(ex) | ||
|
||
cacheFlag := "--cache=true" | ||
|
||
for dockerfile := range d.TestCacheDockerfiles { |
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.
I may be missing something, but this function is called inside a for
loop that also ranges over TestCacheDockerfiles
.
@@ -252,74 +252,99 @@ func TestImageNameTagDigestFile(t *testing.T) { | |||
testutil.CheckErrorAndDeepEqual(t, false, err, want, got) | |||
} | |||
|
|||
var calledExecCommand = []bool{} |
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.
This was never getting mutated anywhere except setCalledFalse
} | ||
if test.ExistingConfig { | ||
afero.WriteFile(fs, util.DockerConfLocation(), []byte(""), os.FileMode(0644)) | ||
defer fs.Remove(util.DockerConfLocation()) | ||
} | ||
CheckPushPermissions(&opts) | ||
for i, shdCall := range test.ShouldCallExecCommand { | ||
if i < len(calledExecCommand) && shdCall != calledExecCommand[i] { |
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.
Because calledExecCommand
is never mutated, it is always 0 length, and this statement is always false; I wasn't exactly sure what this was originally supposed to be testing, but I added checkPushPermsCallCount
to give some more coverage.
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.
LGTM, some small nits that you can choose to ignore if you'd rather not.
Thanks for your patience, and sorry this took so long to get around to.
Thanks @imjasonh! I'll make the changes you suggested... will push up a new commit shortly. |
Signed-off-by: Natalie Arellano <[email protected]>
Description
Adds the ability to provide
--cache-repo
as an OCI image layout path to cache layers on disk.This is useful if you want to avoid providing registry credentials to kaniko (when used together with
--cache-dir
.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes
--cache-repo
as an OCI image layout path to cache layers on disk