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

Function WarnIfAPIVersionBelowSupportedMinimum

command/api_version_warning.go:36–53  ·  view source on GitHub ↗
(apiVersion string, ui UI)

Source from the content-addressed store, hash-verified

34}
35
36func WarnIfAPIVersionBelowSupportedMinimum(apiVersion string, ui UI) error {
37 isOutdated, err := CheckVersionOutdated(apiVersion, ccversion.MinSupportedV2ClientVersion)
38 if err != nil {
39 return err
40 }
41
42 if isOutdated {
43 ui.DisplayWarning("Your CF API version ({{.APIVersion}}) is no longer supported. "+
44 "Upgrade to a newer version of the API (minimum version {{.MinSupportedVersion}}). Please refer to "+
45 "https://github.com/cloudfoundry/cli/wiki/Versioning-Policy#cf-cli-minimum-supported-version",
46 map[string]interface{}{
47 "APIVersion": apiVersion,
48 "MinSupportedVersion": ccversion.MinSupportedV2ClientVersion,
49 })
50 }
51
52 return nil
53}
54
55func CheckVersionOutdated(current string, minimum string) (bool, error) {
56 if current == version.DefaultVersion || minimum == "" {

Callers 1

Calls 2

CheckVersionOutdatedFunction · 0.85
DisplayWarningMethod · 0.65

Tested by

no test coverage detected