IsRemovedIn 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)
| 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 |
| 223 | func (v *Version) isRemovedIn(targetVersions map[string]string) bool { |
| 224 | for component, targetVersion := range targetVersions { |
| 225 | if !semver.IsValid(targetVersion) { |
| 226 | klog.V(3).Infof("targetVersion %s for %s is not valid semVer", targetVersion, component) |
| 227 | return false |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | if v.RemovedIn == "" { |
| 232 | return false |
| 233 | } |
| 234 | |
| 235 | targetVersion, ok := targetVersions[v.Component] |
| 236 | if !ok { |
| 237 | klog.V(3).Infof("targetVersion missing for component %s", v.Component) |
| 238 | return false |
| 239 | } |
| 240 | |
| 241 | comparison := semver.Compare(targetVersion, v.RemovedIn) |
| 242 | return comparison >= 0 |
| 243 | } |
| 244 | |
| 245 | // isReplacementAvailableIn returns true if the replacement api is available in the applicable targetVersion |
| 246 | // Will return false if the targetVersion passed is not a valid semver string |
no outgoing calls