(config Config, apiVersion string, ui UI)
| 13 | } |
| 14 | |
| 15 | func 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 | |
| 36 | func WarnIfAPIVersionBelowSupportedMinimum(apiVersion string, ui UI) error { |
| 37 | isOutdated, err := CheckVersionOutdated(apiVersion, ccversion.MinSupportedV2ClientVersion) |
no test coverage detected