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

Function MinimumUAAAPIVersionCheck

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

Source from the content-addressed store, hash-verified

30}
31
32func MinimumUAAAPIVersionCheck(current string, minimum string, customCommand ...string) error {
33 log.WithFields(log.Fields{"current": current, "minimum": minimum}).Debug("minimum api version")
34 var command string
35 if len(customCommand) > 0 {
36 command = customCommand[0]
37 }
38
39 isOutdated, err := CheckVersionOutdated(current, minimum)
40 if err != nil {
41 return err
42 }
43
44 if isOutdated {
45 log.WithFields(log.Fields{"current": current, "minimum": minimum}).Error("minimum not met")
46 return translatableerror.MinimumUAAAPIVersionNotMetError{
47 Command: command,
48 MinimumVersion: minimum,
49 }
50 }
51
52 return nil
53}

Callers 2

ExecuteMethod · 0.92

Calls 2

CheckVersionOutdatedFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected