ValidateZeroVersion receives a module config, and returns whether the running zero's binary is compatible with the module
(mc ModuleConfig)
| 49 | // ValidateZeroVersion receives a module config, and returns whether the running zero's binary |
| 50 | // is compatible with the module |
| 51 | func ValidateZeroVersion(mc ModuleConfig) bool { |
| 52 | if mc.ZeroVersion.String() == "" { |
| 53 | return true |
| 54 | } |
| 55 | |
| 56 | zeroVersion := version.AppVersion |
| 57 | flog.Debugf("Checking Zero version (%s) against %s", zeroVersion, mc.ZeroVersion) |
| 58 | |
| 59 | // Unreleased versions or test runs, defaults to SNAPSHOT when not declared |
| 60 | if zeroVersion == "SNAPSHOT" { |
| 61 | return true |
| 62 | } |
| 63 | |
| 64 | return checkVersionAgainstConstrains(mc.ZeroVersion, zeroVersion) |
| 65 | } |
| 66 | |
| 67 | type Parameter struct { |
| 68 | Field string |