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

Function MinimumCCAPIVersionCheck

command/minimum_version_check.go:8–30  ·  view source on GitHub ↗
(current string, minimum string, customCommand ...string)

Source from the content-addressed store, hash-verified

6)
7
8func MinimumCCAPIVersionCheck(current string, minimum string, customCommand ...string) error {
9 log.WithFields(log.Fields{"current": current, "minimum": minimum}).Debug("minimum api version")
10 var command string
11 if len(customCommand) > 0 {
12 command = customCommand[0]
13 }
14
15 isOutdated, err := CheckVersionOutdated(current, minimum)
16 if err != nil {
17 return err
18 }
19
20 if isOutdated {
21 log.WithFields(log.Fields{"current": current, "minimum": minimum}).Error("minimum not met")
22 return translatableerror.MinimumCFAPIVersionNotMetError{
23 Command: command,
24 CurrentVersion: current,
25 MinimumVersion: minimum,
26 }
27 }
28
29 return nil
30}
31
32func MinimumUAAAPIVersionCheck(current string, minimum string, customCommand ...string) error {
33 log.WithFields(log.Fields{"current": current, "minimum": minimum}).Debug("minimum api version")

Callers 15

ExecuteMethod · 0.92
ValidateFlagsMethod · 0.92
ExecuteMethod · 0.92
ExecuteMethod · 0.92
ExecuteMethod · 0.92
ExecuteMethod · 0.92
ExecuteMethod · 0.92
ValidateFlagsMethod · 0.92
ValidateFlagsMethod · 0.92

Calls 2

CheckVersionOutdatedFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected