Skip to content

Commit c162e3e

Browse files
STAC-25493: Remove unlock from stackpacks2 commands
1 parent fc307f7 commit c162e3e

2 files changed

Lines changed: 8 additions & 14 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"strconv"
88
"testing"
99

10-
"github.com/blang/semver/v4"
1110
"github.com/spf13/cobra"
1211
"github.com/stackvista/stackstate-cli/internal/di"
1312
"github.com/stretchr/testify/assert"
@@ -177,7 +176,7 @@ func TestStackpackTestDeployCommand_RequiredFlags(t *testing.T) {
177176
},
178177
{
179178
name: "with all flags",
180-
args: []string{"-d", "./test", "-p", "param1=value1", "--yes", "--unlocked-strategy", "force"},
179+
args: []string{"-d", "./test", "-p", "param1=value1", "--yes"},
181180
wantErr: false,
182181
},
183182
}

0 commit comments

Comments
 (0)