-
Notifications
You must be signed in to change notification settings - Fork 3
fix: set MagicDir to tempdir when performing cache probe #48
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
Conversation
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.
Looks like linter is complaining a bit?
Can't build until the linked envbuilder PRs are merged :-) |
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.
Just a few envbuilder related comments, this PR is fine 👍🏻
@@ -34,7 +35,9 @@ func GetRemoteImage(imgRef string) (v1.Image, error) { | |||
// ExtractEnvbuilderFromImage reads the image located at imgRef and extracts | |||
// MagicBinaryLocation to destPath. | |||
func ExtractEnvbuilderFromImage(ctx context.Context, imgRef, destPath string) error { | |||
needle := filepath.Clean(constants.MagicBinaryLocation)[1:] // skip leading '/' | |||
var o eboptions.Options | |||
o.SetDefaults() |
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.
(envbuilder review: Usage here might be nicer with o := eboptions.Defaults()
.)
@@ -467,6 +466,8 @@ func runCacheProbe(ctx context.Context, builderImage string, opts eboptions.Opti | |||
if err := os.MkdirAll(tmpKanikoDir, 0o755); err != nil { | |||
return nil, fmt.Errorf("failed to create kaniko dir: %w", err) | |||
} | |||
// Use the temporary directory as our 'magic dir'. | |||
opts.MagicDirBase = tmpKanikoDir |
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.
(envbuilder nit: "base" makes me think of the directory that should contain the magicdir, i.e. [base]/.envbuilder
).
Relates to #43
Depends on coder/envbuilder#337 and coder/envbuilder#336