Skip to content

Commit

Permalink
PMM-12155 fix linter.
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk committed Oct 10, 2024
1 parent 31cbcff commit f988f3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions managed/services/agents/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ import (
// Starting with pmm 2.28, the exporter uses Prometheus Web Toolkit and needs a config file
// with the basic auth users.
var (
v2_27_99 = version.MustParse("2.27.99")
v1_5_0 = version.MustParse("1.5.0")
v2_28_00 = version.MustParse("2.28.0-0")
)

func nodeExporterConfig(node *models.Node, exporter *models.Agent, agentVersion *version.Parsed) (*agentv1.SetStateRequest_AgentProcess, error) {
Expand Down Expand Up @@ -145,7 +144,7 @@ func nodeExporterConfig(node *models.Node, exporter *models.Agent, agentVersion
Args: args,
}

if err := ensureAuthParams(exporter, params, agentVersion, v2_27_99, agentVersion.IsFeatureSupported(version.NodeExporterNewTLSConfigVersion)); err != nil {
if err := ensureAuthParams(exporter, params, agentVersion, v2_28_00, agentVersion.IsFeatureSupported(version.NodeExporterNewTLSConfigVersion)); err != nil {
return nil, err
}

Expand Down
4 changes: 3 additions & 1 deletion version/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ package version

// versions list.
var (
V3_0_0 = MustParse("3.0.0")
V3_0_0 = MustParse("3.0.0") //nolint:revive
)

// FeatureVersion represents a minimum version feature being supported.
type FeatureVersion *Parsed

// features list.
var (
NodeExporterNewTLSConfigVersion FeatureVersion = V3_0_0
)

// IsFeatureSupported checks if the feature is supported by the version.
func (p *Parsed) IsFeatureSupported(f FeatureVersion) bool {
return !p.Less(f)
}

0 comments on commit f988f3a

Please sign in to comment.