Skip to content

Commit

Permalink
PMM-13416 Fix linters.
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk committed Nov 7, 2024
1 parent d2cf85a commit 3d98245
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions admin/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ func (cmd *ConfigCommand) args(globals *flags.GlobalFlags) ([]string, bool) {
res = append(res, "--server-insecure-tls")
}

if cmd.LogLevel != "" {
res = append(res, fmt.Sprintf("--log-level=%s", cmd.LogLevel))
if cmd.LogLevelFatalFlags.LogLevel != "" {
res = append(res, fmt.Sprintf("--log-level=%s", cmd.LogLevelFatalFlags.LogLevel))
}
if globals.EnableDebug {
res = append(res, "--debug")
Expand All @@ -121,8 +121,8 @@ func (cmd *ConfigCommand) args(globals *flags.GlobalFlags) ([]string, bool) {
res = append(res, "--force")
}

if cmd.MetricsMode != "" {
res = append(res, fmt.Sprintf("--metrics-mode=%s", cmd.MetricsMode))
if cmd.MetricsModeFlags.MetricsMode != "" {
res = append(res, fmt.Sprintf("--metrics-mode=%s", cmd.MetricsModeFlags.MetricsMode))
}

if len(cmd.DisableCollectors) != 0 {
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/inventory/add_agent_mongodb_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (cmd *AddAgentMongodbExporterCommand) RunCmd() (commands.Result, error) {
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
StatsCollections: commands.ParseDisableCollectors(cmd.StatsCollections),
CollectionsLimit: cmd.CollectionsLimit,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/inventory/add_agent_mysqld_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (cmd *AddAgentMysqldExporterCommand) RunCmd() (commands.Result, error) {
PushMetrics: cmd.PushMetrics,
ExposeExporter: cmd.ExposeExporter,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelNoFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/inventory/add_agent_node_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (cmd *AddAgentNodeExporterCommand) RunCmd() (commands.Result, error) {
PushMetrics: cmd.PushMetrics,
ExposeExporter: cmd.ExposeExporter,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelNoFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/inventory/add_agent_postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (cmd *AddAgentPostgresExporterCommand) RunCmd() (commands.Result, error) {
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelNoFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/inventory/add_agent_proxysql_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (cmd *AddAgentProxysqlExporterCommand) RunCmd() (commands.Result, error) {
PushMetrics: cmd.PushMetrics,
ExposeExporter: cmd.ExposeExporter,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (cmd *AddAgentQANMongoDBProfilerAgentCommand) RunCmd() (commands.Result, er
TLSCertificateKeyFilePassword: cmd.TLSCertificateKeyFilePassword,
TLSCa: tlsCa,
AuthenticationMechanism: cmd.AuthenticationMechanism,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ func (cmd *AddAgentQANMySQLPerfSchemaAgentCommand) RunCmd() (commands.Result, er
Password: cmd.Password,
CustomLabels: customLabels,
SkipConnectionCheck: cmd.SkipConnectionCheck,
DisableCommentsParsing: !cmd.CommentsParsingEnabled(),
DisableCommentsParsing: !cmd.CommentsParsingFlags.CommentsParsingEnabled(),
MaxQueryLength: cmd.MaxQueryLength,
DisableQueryExamples: cmd.DisableQueryExamples,
TLS: cmd.TLS,
TLSSkipVerify: cmd.TLSSkipVerify,
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
4 changes: 2 additions & 2 deletions admin/commands/inventory/add_agent_qan_mysql_slowlog_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (cmd *AddAgentQANMySQLSlowlogAgentCommand) RunCmd() (commands.Result, error
Password: cmd.Password,
CustomLabels: customLabels,
SkipConnectionCheck: cmd.SkipConnectionCheck,
DisableCommentsParsing: !cmd.CommentsParsingEnabled(),
DisableCommentsParsing: !cmd.CommentsParsingFlags.CommentsParsingEnabled(),
MaxQueryLength: cmd.MaxQueryLength,
DisableQueryExamples: cmd.DisableQueryExamples,
MaxSlowlogFileSize: strconv.FormatInt(int64(cmd.MaxSlowlogFileSize), 10),
Expand All @@ -129,7 +129,7 @@ func (cmd *AddAgentQANMySQLSlowlogAgentCommand) RunCmd() (commands.Result, error
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ func (cmd *AddAgentQANPostgreSQLPgStatementsAgentCommand) RunCmd() (commands.Res
Password: cmd.Password,
CustomLabels: customLabels,
SkipConnectionCheck: cmd.SkipConnectionCheck,
DisableCommentsParsing: !cmd.CommentsParsingEnabled(),
DisableCommentsParsing: !cmd.CommentsParsingFlags.CommentsParsingEnabled(),
MaxQueryLength: cmd.MaxQueryLength,

TLS: cmd.TLS,
TLSSkipVerify: cmd.TLSSkipVerify,
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (cmd *AddAgentQANPostgreSQLPgStatMonitorAgentCommand) RunCmd() (commands.Re
Password: cmd.Password,
CustomLabels: customLabels,
SkipConnectionCheck: cmd.SkipConnectionCheck,
DisableCommentsParsing: !cmd.CommentsParsingEnabled(),
DisableCommentsParsing: !cmd.CommentsParsingFlags.CommentsParsingEnabled(),
MaxQueryLength: cmd.MaxQueryLength,
DisableQueryExamples: cmd.QueryExamplesDisabled,

Expand All @@ -109,7 +109,7 @@ func (cmd *AddAgentQANPostgreSQLPgStatMonitorAgentCommand) RunCmd() (commands.Re
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/inventory/add_agent_rds_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (cmd *AddAgentRDSExporterCommand) RunCmd() (commands.Result, error) {
DisableBasicMetrics: cmd.DisableBasicMetrics,
DisableEnhancedMetrics: cmd.DisableEnhancedMetrics,
PushMetrics: cmd.PushMetrics,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/management/add_external.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (cmd *AddExternalCommand) RunCmd() (commands.Result, error) {
Cluster: cmd.Cluster,
ReplicationSet: cmd.ReplicationSet,
CustomLabels: customLabels,
MetricsMode: cmd.MetricsMode.EnumValue(),
MetricsMode: cmd.MetricsModeFlags.MetricsMode.EnumValue(),
Group: cmd.Group,
SkipConnectionCheck: cmd.SkipConnectionCheck,
},
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/management/add_haproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (cmd *AddHAProxyCommand) RunCmd() (commands.Result, error) {
Cluster: cmd.Cluster,
ReplicationSet: cmd.ReplicationSet,
CustomLabels: customLabels,
MetricsMode: cmd.MetricsMode.EnumValue(),
MetricsMode: cmd.MetricsModeFlags.MetricsMode.EnumValue(),
SkipConnectionCheck: cmd.SkipConnectionCheck,
},
},
Expand Down
4 changes: 2 additions & 2 deletions admin/commands/management/add_mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ func (cmd *AddMongoDBCommand) RunCmd() (commands.Result, error) {
AuthenticationMechanism: cmd.AuthenticationMechanism,
AuthenticationDatabase: cmd.AuthenticationDatabase,

MetricsMode: cmd.MetricsMode.EnumValue(),
MetricsMode: cmd.MetricsModeFlags.MetricsMode.EnumValue(),

EnableAllCollectors: cmd.EnableAllCollectors,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
StatsCollections: commands.ParseDisableCollectors(cmd.StatsCollections),
CollectionsLimit: cmd.CollectionsLimit,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
6 changes: 3 additions & 3 deletions admin/commands/management/add_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (cmd *AddMySQLCommand) RunCmd() (commands.Result, error) {
QANMysqlPerfschema: cmd.QuerySource == MysqlQuerySourcePerfSchema,

SkipConnectionCheck: cmd.SkipConnectionCheck,
DisableCommentsParsing: !cmd.CommentsParsingEnabled(),
DisableCommentsParsing: !cmd.CommentsParsingFlags.CommentsParsingEnabled(),
MaxQueryLength: cmd.MaxQueryLength,
DisableQueryExamples: cmd.DisableQueryExamples,

Expand All @@ -235,9 +235,9 @@ func (cmd *AddMySQLCommand) RunCmd() (commands.Result, error) {
TLSCert: tlsCert,
TLSKey: tlsKey,
TablestatsGroupTableLimit: tablestatsGroupTableLimit,
MetricsMode: cmd.MetricsMode.EnumValue(),
MetricsMode: cmd.MetricsModeFlags.MetricsMode.EnumValue(),
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelNoFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
6 changes: 3 additions & 3 deletions admin/commands/management/add_postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (cmd *AddPostgreSQLCommand) RunCmd() (commands.Result, error) {
Database: cmd.Database,
AgentPassword: cmd.AgentPassword,
SkipConnectionCheck: cmd.SkipConnectionCheck,
DisableCommentsParsing: !cmd.CommentsParsingEnabled(),
DisableCommentsParsing: !cmd.CommentsParsingFlags.CommentsParsingEnabled(),

PMMAgentID: cmd.PMMAgentID,
Environment: cmd.Environment,
Expand All @@ -208,11 +208,11 @@ func (cmd *AddPostgreSQLCommand) RunCmd() (commands.Result, error) {

MaxQueryLength: cmd.MaxQueryLength,
DisableQueryExamples: cmd.DisableQueryExamples,
MetricsMode: cmd.MetricsMode.EnumValue(),
MetricsMode: cmd.MetricsModeFlags.MetricsMode.EnumValue(),
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
AutoDiscoveryLimit: cmd.AutoDiscoveryLimit,
MaxExporterConnections: cmd.MaxExporterConnections,
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelNoFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
4 changes: 2 additions & 2 deletions admin/commands/management/add_proxysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ func (cmd *AddProxySQLCommand) RunCmd() (commands.Result, error) {
SkipConnectionCheck: cmd.SkipConnectionCheck,
TLS: cmd.TLS,
TLSSkipVerify: cmd.TLSSkipVerify,
MetricsMode: cmd.MetricsMode.EnumValue(),
MetricsMode: cmd.MetricsModeFlags.MetricsMode.EnumValue(),
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: cmd.LogLevel.EnumValue(),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
},
},
Context: commands.Ctx,
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/management/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (cmd *RegisterCommand) RunCmd() (commands.Result, error) {
AgentPassword: cmd.AgentPassword,

Reregister: cmd.Force,
MetricsMode: cmd.MetricsMode.EnumValue(),
MetricsMode: cmd.MetricsModeFlags.MetricsMode.EnumValue(),
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
},
Context: commands.Ctx,
Expand Down

0 comments on commit 3d98245

Please sign in to comment.