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

Method isDeprecatedIn

pkg/api/versions.go:199–219  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 3

FilterOutputMethod · 0.80
GetReturnCodeMethod · 0.80

Calls

no outgoing calls

Tested by 1