MCPcopy
hub / github.com/cloudfoundry/cli / WarnIfCLIVersionBelowAPIDefinedMinimum

Function WarnIfCLIVersionBelowAPIDefinedMinimum

command/api_version_warning.go:15–34  ·  view source on GitHub ↗
(config Config, apiVersion string, ui UI)

Source from the content-addressed store, hash-verified

13}
14
15func WarnIfCLIVersionBelowAPIDefinedMinimum(config Config, apiVersion string, ui UI) error {
16 minVer := config.MinCLIVersion()
17 currentVer := config.BinaryVersion()
18
19 isOutdated, err := CheckVersionOutdated(currentVer, minVer)
20 if err != nil {
21 return err
22 }
23
24 if isOutdated {
25 ui.DisplayWarning("Cloud Foundry API version {{.APIVersion}} requires CLI version {{.MinCLIVersion}}. You are currently on version {{.BinaryVersion}}. To upgrade your CLI, please visit: https://github.com/cloudfoundry/cli#downloads",
26 map[string]interface{}{
27 "APIVersion": apiVersion,
28 "MinCLIVersion": minVer,
29 "BinaryVersion": currentVer,
30 })
31 }
32
33 return nil
34}
35
36func WarnIfAPIVersionBelowSupportedMinimum(apiVersion string, ui UI) error {
37 isOutdated, err := CheckVersionOutdated(apiVersion, ccversion.MinSupportedV2ClientVersion)

Callers 1

Calls 4

CheckVersionOutdatedFunction · 0.85
MinCLIVersionMethod · 0.65
BinaryVersionMethod · 0.65
DisplayWarningMethod · 0.65

Tested by

no test coverage detected