From d50bf5b518867a546161b34ad8fb593c5407e48d Mon Sep 17 00:00:00 2001 From: Sven Rebhan Date: Wed, 17 Nov 2021 14:55:34 +0100 Subject: [PATCH] Drop potential pre-release tags for telegraf when comparing the versions. --- config/deprecation.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/deprecation.go b/config/deprecation.go index 8f99b5d034cf1..1316b5b6664ab 100644 --- a/config/deprecation.go +++ b/config/deprecation.go @@ -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 @@ -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) {