MCPcopy Index your code
hub / github.com/FairwindsOps/pluto / isRemovedIn

Method isRemovedIn

pkg/api/versions.go:223–243  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
223func (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

Callers 3

TestVersion_IsRemovedInFunction · 0.95
FilterOutputMethod · 0.80
GetReturnCodeMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestVersion_IsRemovedInFunction · 0.76