Skip to content

Commit

Permalink
Update v8 to have a minimum CAPI version of 1.109.0 (v3 API v3.99.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenna Goldstrich committed Jul 9, 2021
1 parent 5cfbf04 commit 61d6885
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions command/v7/auth_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var _ = Describe("auth Command", func() {
binaryName = "faceman"
fakeConfig.BinaryNameReturns(binaryName)
fakeConfig.UAAOAuthClientReturns("cf")
fakeConfig.APIVersionReturns("3.85.0")
fakeConfig.APIVersionReturns("3.99.0")
})

JustBeforeEach(func() {
Expand Down Expand Up @@ -215,7 +215,7 @@ var _ = Describe("auth Command", func() {
It("warns that the user is targeting an unsupported API version and that things may not work correctly", func() {
Expect(err).ToNot(HaveOccurred())
Expect(testUI.Out).To(Say("API endpoint: %s", fakeConfig.Target()))
Expect(testUI.Err).To(Say("Warning: Your targeted API's version \\(3.83.0\\) is less than the minimum supported API version \\(3.85.0\\). Some commands may not function correctly."))
Expect(testUI.Err).To(Say("Warning: Your targeted API's version \\(3.83.0\\) is less than the minimum supported API version \\(3.99.0\\). Some commands may not function correctly."))
})
})

Expand Down
4 changes: 2 additions & 2 deletions command/v7/login_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var _ = Describe("login Command", func() {
cmd.APIEndpoint = ""

fakeActorReloader.ReloadReturns(fakeActor, nil)
fakeConfig.APIVersionReturns("3.85.0")
fakeConfig.APIVersionReturns("3.99.0")
})

JustBeforeEach(func() {
Expand Down Expand Up @@ -192,7 +192,7 @@ var _ = Describe("login Command", func() {
fakeConfig.APIVersionReturns("3.83.0")
})
It("warns that the user is targeting an unsupported API version and that things may not work correctly", func() {
Expect(testUI.Err).To(Say("Warning: Your targeted API's version \\(3.83.0\\) is less than the minimum supported API version \\(3.85.0\\). Some commands may not function correctly."))
Expect(testUI.Err).To(Say("Warning: Your targeted API's version \\(3.83.0\\) is less than the minimum supported API version \\(3.99.0\\). Some commands may not function correctly."))
})
})

Expand Down
6 changes: 3 additions & 3 deletions command/v7/shared/version_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import (
"github.com/blang/semver"
)

const minimumCCAPIVersionForV7 = "3.85.0"
const minimumCCAPIVersionForV8 = "3.99.0"

func CheckCCAPIVersion(currentAPIVersion string) (string, error) {
currentSemver, err := semver.Make(currentAPIVersion)
if err != nil {
return "", err
}

minimumSemver, err := semver.Make(minimumCCAPIVersionForV7)
minimumSemver, err := semver.Make(minimumCCAPIVersionForV8)
if err != nil {
return "", err
}

if currentSemver.LT(minimumSemver) {
return fmt.Sprintf("\nWarning: Your targeted API's version (%s) is less than the minimum supported API version (%s). Some commands may not function correctly.", currentAPIVersion, minimumCCAPIVersionForV7), nil
return fmt.Sprintf("\nWarning: Your targeted API's version (%s) is less than the minimum supported API version (%s). Some commands may not function correctly.", currentAPIVersion, minimumCCAPIVersionForV8), nil
}

return "", nil
Expand Down
4 changes: 2 additions & 2 deletions command/v7/shared/version_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var _ = Describe("version checker", func() {

Context("CheckCCAPIVersion", func() {
BeforeEach(func() {
currentCCVersion = "3.85.0"
currentCCVersion = "3.99.0"
})

JustBeforeEach(func() {
Expand All @@ -34,7 +34,7 @@ var _ = Describe("version checker", func() {

It("does return a warning", func() {
Expect(executeErr).ToNot(HaveOccurred())
Expect(warning).To(Equal("\nWarning: Your targeted API's version (3.83.0) is less than the minimum supported API version (3.85.0). Some commands may not function correctly."))
Expect(warning).To(Equal("\nWarning: Your targeted API's version (3.83.0) is less than the minimum supported API version (3.99.0). Some commands may not function correctly."))
})
})

Expand Down

0 comments on commit 61d6885

Please sign in to comment.