Repository navigation
fix: reject --startup-script for container and compose modes - #530
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
applyBuildMode only attaches the script for vm and k8s, so -m container and -m compose dropped -s/--startup-script with no error. validateBuildMode now rejects that combination the same way it rejects a missing image or compose file.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is no issue for this path. This does not fix #383: that report is about vm instances, where the CLI already sends the script and the instance still does not run it.
Cause
brev create -m containerand-m composeaccept--startup-script/-s.applyBuildModecopies the script intoVMBuild.LifeCycleScriptAttronly forvmandk8s. Container and compose builds have no lifecycle-script field, so the flag was dropped and the command succeeded as if it had not been passed. An@filepath was still opened, then ignored when the file existed.Fix
validateBuildModenow returns a validation error when a startup script is set forcontainerorcompose, using the same error type as the other mode checks. The check runs before the script file is read.vmandk8sare unchanged. The flag help text says the script applies only to those modes.Test
go test -count=1 -timeout 180s -run 'TestCreateRejectsStartupScriptForContainerAndCompose|TestValidateBuildModeStartupScript' ./pkg/cmd/gpucreate/Without the new check, both tests fail: container and compose with an inline script return success, and
@setup.shfails with "open setup.sh" instead of the mode error. With the check, those tests and the rest of./pkg/cmd/gpucreatepass.This change was prepared with the help of an AI assistant and reviewed before submission.