IsDeprecatedIn returns true if the version is deprecated in the applicable targetVersion Will return false if the targetVersion passed is not a valid semver string
(targetVersions map[string]string)
| 197 | // IsDeprecatedIn returns true if the version is deprecated in the applicable targetVersion |
| 198 | // Will return false if the targetVersion passed is not a valid semver string |
| 199 | func (v *Version) isDeprecatedIn(targetVersions map[string]string) bool { |
| 200 | for component, targetVersion := range targetVersions { |
| 201 | if !semver.IsValid(targetVersion) { |
| 202 | klog.V(3).Infof("targetVersion %s for %s is not valid semVer", targetVersion, component) |
| 203 | return false |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | if v.DeprecatedIn == "" { |
| 208 | return false |
| 209 | } |
| 210 | |
| 211 | targetVersion, ok := targetVersions[v.Component] |
| 212 | if !ok { |
| 213 | klog.V(3).Infof("targetVersion missing for component %s", v.Component) |
| 214 | return false |
| 215 | } |
| 216 | |
| 217 | comparison := semver.Compare(targetVersion, v.DeprecatedIn) |
| 218 | return comparison >= 0 |
| 219 | } |
| 220 | |
| 221 | // IsRemovedIn returns true if the version is deprecated in the applicable targetVersion |
| 222 | // Will return false if the targetVersion passed is not a valid semver string |
no outgoing calls