Skip to content

Commit ff65739

Browse files
Merge pull request #158 from StackVista/stac-25493
STAC-25493: Remove unlock from stackpacks2 commands
2 parents fc307f7 + 033e246 commit ff65739

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

‎cmd/stackpack/stackpack_test_deploy_cmd.go‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ const (
2323

2424
// TestDeployArgs contains arguments for stackpack test-deploy command
2525
type TestDeployArgs struct {
26-
StackpackDir string
27-
Params map[string]string
28-
Yes bool
29-
UnlockedStrategy string
26+
StackpackDir string
27+
Params map[string]string
28+
Yes bool
3029
}
3130

3231
// StackpackTestDeployCommand creates the test-deploy subcommand
@@ -55,18 +54,14 @@ sts stackpack test-deploy -p "param1=value1"
5554
# Skip confirmation prompt
5655
sts stackpack test-deploy --yes
5756
58-
# Test stackpack in specific directory with unlocked strategy
59-
sts stackpack test-deploy -d ./my-stackpack --yes --unlocked-strategy force
60-
61-
# Test with custom unlocked strategy
62-
sts stackpack test-deploy --unlocked-strategy skip --yes`,
57+
# Test stackpack in specific directory
58+
sts stackpack test-deploy -d ./my-stackpack --yes`,
6359
RunE: cli.CmdRunEWithApi(RunStackpackTestDeployCommand(args)),
6460
}
6561

6662
cmd.Flags().StringVarP(&args.StackpackDir, "stackpack-directory", "d", "", "Path to stackpack directory (defaults to current directory)")
6763
cmd.Flags().StringToStringVarP(&args.Params, ParameterFlag, "p", args.Params, "List of parameters of the form \"key=value\"")
6864
cmd.Flags().BoolVarP(&args.Yes, "yes", "y", false, "Skip confirmation prompt before upload")
69-
cmd.Flags().StringVar(&args.UnlockedStrategy, UnlockedStrategyFlag, "fail", "Strategy for dealing with unlocked StackPacks. Valid options are: fail, force, skip")
7065

7166
return cmd
7267
}
@@ -214,7 +209,7 @@ func RunStackpackTestDeployCommand(args *TestDeployArgs) di.CmdWithApiFn {
214209
if installedVersion != "" {
215210
upgradeArgs := &UpgradeArgs{
216211
TypeName: originalInfo.Name,
217-
UnlockedStrategy: args.UnlockedStrategy,
212+
UnlockedStrategy: "fail",
218213
Wait: true,
219214
Timeout: DefaultTimeout,
220215
}
@@ -226,7 +221,7 @@ func RunStackpackTestDeployCommand(args *TestDeployArgs) di.CmdWithApiFn {
226221
} else {
227222
installArgs := &InstallArgs{
228223
Name: originalInfo.Name,
229-
UnlockedStrategy: args.UnlockedStrategy,
224+
UnlockedStrategy: "fail",
230225
Params: args.Params,
231226
Wait: true,
232227
Timeout: DefaultTimeout,

‎cmd/stackpack/stackpack_test_deploy_cmd_test.go‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ func TestStackpackTestDeployCommand_FlagsAndStructure(t *testing.T) {
4444
yesFlag := flags.Lookup("yes")
4545
require.NotNil(t, yesFlag)
4646
assert.Equal(t, "y", yesFlag.Shorthand)
47-
48-
unlockedStrategyFlag := flags.Lookup("unlocked-strategy")
49-
require.NotNil(t, unlockedStrategyFlag)
50-
assert.Equal(t, "fail", unlockedStrategyFlag.DefValue)
5147
}
5248

5349
func TestBumpSnapshotVersion(t *testing.T) {
@@ -177,7 +173,7 @@ func TestStackpackTestDeployCommand_RequiredFlags(t *testing.T) {
177173
},
178174
{
179175
name: "with all flags",
180-
args: []string{"-d", "./test", "-p", "param1=value1", "--yes", "--unlocked-strategy", "force"},
176+
args: []string{"-d", "./test", "-p", "param1=value1", "--yes"},
181177
wantErr: false,
182178
},
183179
}

0 commit comments

Comments
 (0)