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

build: support cancellation of custom image builds #5971

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

nicks
Copy link
Member

@nicks nicks commented Nov 11, 2022

Custom image builds now create an explicit Cmd object in the API server. But for now these Cmds are kept up to date as part of the buildcontroller, rather than by the runtime controller.

Fixes #5926

Signed-off-by: Nick Santos [email protected]

@nicks nicks requested review from milas and landism November 11, 2022 00:51
@@ -107,20 +106,21 @@ func (b *CustomBuilder) Build(ctx context.Context, refs container.RefSet,
l.Infof(" %s", v)
}
}
cmd.Env = append(os.Environ(), extraEnvVars...)
err = imagemap.InjectIntoLocalEnv(cmd, spec.ImageMaps, imageMaps)
cmd.Spec.Env = append(cmd.Spec.Env, extraEnvVars...)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the spec already have the os.Environ()?

AFAICT we don't add it before execing in ForceRun -> https://github.com/nicks/tilt/blob/cfca55cae493dce8616a0ebf986d10e9922eec0a/internal/controllers/core/cmd/controller.go#L389-L399

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 169 to 170
var cmd v1alpha1.Cmd
if iTarget.CmdImageName != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmd is going to always be non-nil, which might be unexpected within Build() - might be better to pass a nil pointer if there is no custom build command

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, that's a good point

Custom image builds now create an explicit Cmd object
in the API server. But for now these Cmds are kept up
to date as part of the buildcontroller, rather than
by the runtime controller.

Fixes tilt-dev#5926

Signed-off-by: Nick Santos <[email protected]>
@nicks nicks merged commit e2ad6ab into tilt-dev:master Nov 14, 2022
@nicks nicks deleted the nicks/issue5926 branch November 14, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

custom_build not handling cancellation correctly
2 participants