Skip to content

Commit

Permalink
Drop potential pre-release tags for telegraf when comparing the versi…
Browse files Browse the repository at this point in the history
…ons.
  • Loading branch information
Sven Rebhan committed Nov 17, 2021
1 parent 184d745 commit d50bf5b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/deprecation.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type deprecationInfo struct {
info telegraf.DeprecationInfo
}

func (di *deprecationInfo) determineEscalation(version semver.Version) error {
func (di *deprecationInfo) determineEscalation(telegrafVersion semver.Version) error {
di.LogLevel = None
if di.info.Since == "" {
return nil
Expand All @@ -70,6 +70,12 @@ func (di *deprecationInfo) determineEscalation(version semver.Version) error {
di.info.RemovalIn = removal.String()
}

// Drop potential pre-release tags
version := semver.Version{
Major: telegrafVersion.Major,
Minor: telegrafVersion.Minor,
Patch: telegrafVersion.Patch,
}
if version.GTE(removal) {
di.LogLevel = Error
} else if version.GTE(since) {
Expand Down

0 comments on commit d50bf5b

Please sign in to comment.