-
Notifications
You must be signed in to change notification settings - Fork 1
fix: expand cache probe support to more directives #17
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
19cd569
to
e20fba2
Compare
e20fba2
to
63195d1
Compare
} | ||
logrus.Infof("Changed working directory to %s", config.WorkingDir) | ||
|
||
// TODO(mafredri): Check if we need to do more here. |
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.
What are you concerned about?
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.
If this command runs in a build (uncached) and the target directory doesn't exist, it will be created and added to w.snapshotFiles
. My concern is if we need to mimic this behavior or not when running cached.
Testing or experience should tell us, though, so maybe I'll just remove the TODO.
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'm fine with leaving TODO here, we can always remove it later. Thanks for sharing the context!
@@ -79,6 +79,30 @@ func (w *WorkdirCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile | |||
return nil | |||
} | |||
|
|||
func (w *WorkdirCommand) CachedExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error { | |||
logrus.Info("Cmd: workdir") |
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.
nit: wouldn't it be noisy?
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 is copy paste from the uncached execute, felt it's better to mimic the behavior.
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.
Gotcha 👍
existingVolumes[volume] = x | ||
util.AddVolumePathToIgnoreList(volume) | ||
} | ||
config.Volumes = existingVolumes |
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.
maybe add logrus.Info()
to indicate which volumes will be ignored while building?
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 logic is copy paste from the uncached execute command. I don't think we should alter the behavior here 🤔
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 was thinking only about improvements of debugging life, but it can be left as is 👍
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.
That's valid. We could always add it to both but maybe that's suited for a separate debugging PR.
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.
Fingers crossed!
Fixes coder/envbuilder#254