(current string, minimum string, customCommand ...string)
| 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") |
| 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 | } |
no test coverage detected