Skip to content

Commit e44f012

Browse files
committed
Add minimum API version check for update-stack command (3.210.0)
1 parent 64ec3ed commit e44f012

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

api/cloudcontroller/ccversion/minimum_version.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ const (
2424
MinVersionCanarySteps = "3.189.0"
2525

2626
MinVersionServiceBindingStrategy = "3.205.0"
27+
28+
MinVersionUpdateStack = "3.210.0"
2729
)

command/v7/update_stack_command.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"slices"
55
"strings"
66

7+
"code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccversion"
8+
"code.cloudfoundry.org/cli/v8/command"
79
"code.cloudfoundry.org/cli/v8/command/flag"
810
"code.cloudfoundry.org/cli/v8/resources"
911
)
@@ -18,7 +20,12 @@ type UpdateStackCommand struct {
1820
}
1921

2022
func (cmd UpdateStackCommand) Execute(args []string) error {
21-
err := cmd.SharedActor.CheckTarget(false, false)
23+
err := command.MinimumCCAPIVersionCheck(cmd.Config.APIVersion(), ccversion.MinVersionUpdateStack)
24+
if err != nil {
25+
return err
26+
}
27+
28+
err = cmd.SharedActor.CheckTarget(false, false)
2229
if err != nil {
2330
return err
2431
}

command/v7/update_stack_command_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ var _ = Describe("update-stack Command", func() {
5151

5252
binaryName = "faceman"
5353
fakeConfig.BinaryNameReturns(binaryName)
54+
fakeConfig.APIVersionReturns("3.210.0")
5455
})
5556

5657
Context("When the environment is not setup correctly", func() {

0 commit comments

Comments
 (0)