(current string, minimum string, customCommand ...string)
| 6 | ) |
| 7 | |
| 8 | func 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 | |
| 32 | func MinimumUAAAPIVersionCheck(current string, minimum string, customCommand ...string) error { |
| 33 | log.WithFields(log.Fields{"current": current, "minimum": minimum}).Debug("minimum api version") |
no test coverage detected