Skip to content

Commit

Permalink
Enable revive (#2773)
Browse files Browse the repository at this point in the history
* resolved conflict and made changes again

* formated the changes

* corrected the make format error ./agent/agents/mysql/slowlog/slowlog.go:723:30: missing ',' in argument list

* corrected the make format error ./agent/agents/mysql/slowlog/slowlog.go:723:30: missing ',' in argument list

* resolved the remaining linter warnings

* made the requested changes

* made changes to cleare main check

* made changes to cleare main check

* formatted the changes

* made changes to cleare main check

* formatted the changes

* Remove unused lint.

* Another changes.

* make gen

* Another lint.

* Another lint.

* Another lint.

* Lint.

* Lint godot.

* Update managed/services/agents/versioner.go

Co-authored-by: Alex Demidoff <[email protected]>

---------

Co-authored-by: Jiří Čtvrtka <[email protected]>
Co-authored-by: Jiří Čtvrtka <[email protected]>
Co-authored-by: Alex Demidoff <[email protected]>
  • Loading branch information
4 people authored Feb 12, 2024
1 parent 64ff314 commit 88a6f18
Show file tree
Hide file tree
Showing 165 changed files with 4,190 additions and 178 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ linters:
# TODO: carefully review all the rules below and either fix the code
# or leave disabled and provide a reason why
#- tagliatelle
- revive
#- revive
- paralleltest
- gocognit
- tagalign
Expand Down
10 changes: 6 additions & 4 deletions admin/agentlocal/agentlocal.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ func SetTransport(ctx context.Context, debug bool, port uint32) {
client.Default.SetTransport(transport)
}

// NetworkInfo represents information about the network.
type NetworkInfo bool

const (
RequestNetworkInfo NetworkInfo = true
DoNotRequestNetworkInfo NetworkInfo = false
Localhost = "127.0.0.1"
DefaultPMMAgentListenPort = 7777
RequestNetworkInfo NetworkInfo = true //nolint:revive
DoNotRequestNetworkInfo NetworkInfo = false //nolint:revive
Localhost = "127.0.0.1" //nolint:revive
DefaultPMMAgentListenPort = 7777 //nolint:revive
)

// ErrNotSetUp is returned by GetStatus when pmm-agent is running, but not set up.
Expand Down Expand Up @@ -81,6 +82,7 @@ type Status struct {
ConnectionUptime float32 `json:"connection_uptime"`
}

// AgentStatus represents the status of the agent.
type AgentStatus struct {
AgentID string `json:"agent_id"`
AgentType string `json:"agent_type"`
Expand Down
2 changes: 2 additions & 0 deletions admin/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (c *PMMAdminCommands) Run(ctx *kong.Context, globals *flags.GlobalFlags) er
return run(ctx, globals)
}

// GetGlobalFlags returns the global flags for PMMAdminCommands.
func (c *PMMAdminCommands) GetGlobalFlags() *flags.GlobalFlags {
return &c.GlobalFlags
}
Expand All @@ -81,6 +82,7 @@ type PMMCommands struct {
Completion commands.CompletionCommand `cmd:"" help:"Outputs shell code for initialising tab completions"`
}

// GetGlobalFlags returns the global flags for PMMAdminCommands.
func (c *PMMCommands) GetGlobalFlags() *flags.GlobalFlags {
return &c.GlobalFlags
}
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/pmm-admin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package main.
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/pmm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package main.
package main

import (
Expand Down
4 changes: 4 additions & 0 deletions admin/commands/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,19 @@ func ReadFromSource(src string) (*Credentials, error) {
return &creds, nil
}

// ErrorResponse defines the interface for error responses.
type ErrorResponse interface {
error
Code() int
}

// Error represents an error with additional information.
type Error struct {
Code int `json:"code"`
Error string `json:"error"`
}

// GetError converts an ErrorResponse to an Error.
func GetError(err ErrorResponse) Error {
v := reflect.ValueOf(err)
p := v.Elem().FieldByName("Payload")
Expand All @@ -131,6 +134,7 @@ func GetError(err ErrorResponse) Error {
}
}

// ParseTemplate parses the input text into a template.Template.
func ParseTemplate(text string) *template.Template {
t := template.New("").Option("missingkey=error")
return template.Must(t.Parse(strings.TrimSpace(text)))
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_external_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type AddAgentExternalExporterCommand struct {
PushMetrics bool `help:"Enables push metrics model flow, it will be sent to the server by an agent"`
}

// RunCmd executes the AddAgentExternalExporterCommand and returns the result.
func (cmd *AddAgentExternalExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_mongodb_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type AddAgentMongodbExporterCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentMongodbExporterCommand and returns the result.
func (cmd *AddAgentMongodbExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_mysqld_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type AddAgentMysqldExporterCommand struct {
LogLevel string `enum:"debug,info,warn,error" default:"warn" help:"Service logging level. One of: [debug, info, warn, error]"`
}

// RunCmd executes the AddAgentMysqldExporterCommand and returns the result.
func (cmd *AddAgentMysqldExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_node_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type AddAgentNodeExporterCommand struct {
LogLevel string `enum:"debug,info,warn,error" default:"warn" help:"Service logging level. One of: [debug, info, warn, error]"`
}

// RunCmd runs the command for AddAgentNodeExporterCommand.
func (cmd *AddAgentNodeExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &agents.AddNodeExporterParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_pmm_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type AddPMMAgentCommand struct {
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
}

// RunCmd executes the AddPMMAgentCommand and returns the result.
func (cmd *AddPMMAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &agents.AddPMMAgentParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type AddAgentPostgresExporterCommand struct {
AutoDiscoveryLimit int32 `default:"0" placeholder:"NUMBER" help:"Auto-discovery will be disabled if there are more than that number of databases (default: server-defined, -1: always disabled)"`
}

// RunCmd executes the AddAgentPostgresExporterCommand and returns the result.
func (cmd *AddAgentPostgresExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_proxysql_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type AddAgentProxysqlExporterCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentProxysqlExporterCommand and returns the result.
func (cmd *AddAgentProxysqlExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &agents.AddProxySQLExporterParams{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type AddAgentQANMongoDBProfilerAgentCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentQANMongoDBProfilerAgentCommand and returns the result.
func (cmd *AddAgentQANMongoDBProfilerAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type AddAgentQANMySQLPerfSchemaAgentCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd runs the command for AddAgentQANMySQLPerfSchemaAgentCommand.
func (cmd *AddAgentQANMySQLPerfSchemaAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type AddAgentQANMySQLSlowlogAgentCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentQANMySQLSlowlogAgentCommand and returns the result.
func (cmd *AddAgentQANMySQLSlowlogAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type AddAgentQANPostgreSQLPgStatementsAgentCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentQANPostgreSQLPgStatementsAgentCommand and returns the result.
func (cmd *AddAgentQANPostgreSQLPgStatementsAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type AddAgentQANPostgreSQLPgStatMonitorAgentCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd runs the command for AddAgentQANPostgreSQLPgStatMonitorAgentCommand.
func (cmd *AddAgentQANPostgreSQLPgStatMonitorAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_rds_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type AddAgentRDSExporterCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentRDSExporterCommand and returns the result.
func (cmd *AddAgentRDSExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &agents.AddRDSExporterParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_node_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type AddNodeContainerCommand struct {
NodeModel string `help:"Node model"`
}

// RunCmd executes the AddNodeContainerCommand and returns the result.
func (cmd *AddNodeContainerCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &nodes.AddContainerNodeParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_node_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type AddNodeGenericCommand struct {
NodeModel string `help:"Node mddel"`
}

// RunCmd executes the AddNodeGenericCommand and returns the result.
func (cmd *AddNodeGenericCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &nodes.AddGenericNodeParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_node_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type AddNodeRemoteCommand struct {
Az string `help:"Node availability zone"`
}

// RunCmd executes the AddNodeRemoteCommand and returns the result.
func (cmd *AddNodeRemoteCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &nodes.AddRemoteNodeParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_node_remote_rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type AddNodeRemoteRDSCommand struct {
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
}

// RunCmd executes the AddNodeRemoteRDSCommand and returns the result.
func (cmd *AddNodeRemoteRDSCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &nodes.AddRemoteRDSNodeParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_service_external.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type AddServiceExternalCommand struct {
Group string `help:"Group name of external service"`
}

// RunCmd executes the AddServiceExternalCommand and returns the result.
func (cmd *AddServiceExternalCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_service_haproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type AddServiceHAProxyCommand struct {
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
}

// RunCmd executes the AddServiceHAProxyCommand and returns the result.
func (cmd *AddServiceHAProxyCommand) RunCmd() (commands.Result, error) {
isSupported, err := helpers.IsHAProxySupported()
if !isSupported {
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_service_mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type AddServiceMongoDBCommand struct {
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
}

// RunCmd executes the AddServiceMongoDBCommand and returns the result.
func (cmd *AddServiceMongoDBCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &services.AddMongoDBServiceParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_service_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type AddServiceMySQLCommand struct {
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
}

// RunCmd runs the command for AddServiceMySQLCommand.
func (cmd *AddServiceMySQLCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &services.AddMySQLServiceParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_service_postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type AddServicePostgreSQLCommand struct {
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
}

// RunCmd executes the AddServicePostgreSQLCommand and returns the result.
func (cmd *AddServicePostgreSQLCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_service_proxysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type AddServiceProxySQLCommand struct {
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
}

// RunCmd executes the AddServiceProxySQLCommand and returns the result.
func (cmd *AddServiceProxySQLCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &services.AddProxySQLServiceParams{
Expand Down
2 changes: 1 addition & 1 deletion admin/commands/inventory/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

// InventoryCommand is used by Kong for CLI flags and commands.
type InventoryCommand struct {
type InventoryCommand struct { //nolint:revive
List ListCommand `cmd:"" help:"List inventory commands"`
Add AddCommand `cmd:"" help:"Add to inventory commands"`
Remove RemoveCommand `cmd:"" help:"Remove from inventory commands"`
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/list_agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type ListAgentsCommand struct {
AgentType string `help:"Filter by Agent type"`
}

// RunCmd executes the ListAgentsCommand and returns the result.
func (cmd *ListAgentsCommand) RunCmd() (commands.Result, error) {
agentType, err := formatTypeValue(acceptableAgentTypes, cmd.AgentType)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/list_nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type ListNodesCommand struct {
NodeType string `help:"Filter by Node type"`
}

// RunCmd executes the ListNodesCommand and returns the result.
func (cmd *ListNodesCommand) RunCmd() (commands.Result, error) {
nodeType, err := formatTypeValue(acceptableNodeTypes, cmd.NodeType)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/list_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type ListServicesCommand struct {
ExternalGroup string `help:"Filter by external group"`
}

// RunCmd executes the ListServicesCommand and returns the result.
func (cmd *ListServicesCommand) RunCmd() (commands.Result, error) {
serviceType, err := formatTypeValue(acceptableServiceTypes, cmd.ServiceType)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/remove_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type RemoveAgentCommand struct {
Force bool `help:"Remove agent with all dependencies"`
}

// RunCmd executes the RemoveAgentCommand and returns the result.
func (cmd *RemoveAgentCommand) RunCmd() (commands.Result, error) {
params := &agents.RemoveAgentParams{
Body: agents.RemoveAgentBody{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/remove_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type RemoveNodeCommand struct {
Force bool `help:"Remove node with all dependencies"`
}

// RunCmd runs the command for RemoveNodeCommand.
func (cmd *RemoveNodeCommand) RunCmd() (commands.Result, error) {
params := &nodes.RemoveNodeParams{
Body: nodes.RemoveNodeBody{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/remove_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type RemoveServiceCommand struct {
Force bool `help:"Remove service with all dependencies"`
}

// RunCmd executes the RemoveServiceCommand and returns the result.
func (cmd *RemoveServiceCommand) RunCmd() (commands.Result, error) {
params := &services.RemoveServiceParams{
Body: services.RemoveServiceBody{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ type ListCommand struct {
NodeID string `help:"Node ID (default is autodetected)"`
}

// RunCmd executes the List command and returns the result.
func (cmd *ListCommand) RunCmd() (Result, error) {
if cmd.NodeID == "" {
status, err := agentlocal.GetStatus(agentlocal.DoNotRequestNetworkInfo)
Expand Down
2 changes: 2 additions & 0 deletions admin/commands/management/add_external.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ type AddExternalCommand struct {
SkipConnectionCheck bool `help:"Skip exporter connection checks"`
}

// GetCredentials returns the credentials for AddExternalCommand.
func (cmd *AddExternalCommand) GetCredentials() error {
creds, err := commands.ReadFromSource(cmd.CredentialsSource)
if err != nil {
Expand All @@ -85,6 +86,7 @@ func (cmd *AddExternalCommand) GetCredentials() error {
return nil
}

// RunCmd runs the command for AddExternalCommand.
func (cmd *AddExternalCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
2 changes: 2 additions & 0 deletions admin/commands/management/add_external_serverless.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ or even you can specify --address instead of host and port as individual paramet
`
}

// GetCredentials returns the credentials for AddExternalServerlessCommand.
func (cmd *AddExternalServerlessCommand) GetCredentials() error {
creds, err := commands.ReadFromSource(cmd.CredentialsSource)
if err != nil {
Expand All @@ -100,6 +101,7 @@ func (cmd *AddExternalServerlessCommand) GetCredentials() error {
return nil
}

// RunCmd runs the command for AddExternalServerlessCommand.
func (cmd *AddExternalServerlessCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
2 changes: 2 additions & 0 deletions admin/commands/management/add_haproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type AddHAProxyCommand struct {
SkipConnectionCheck bool `help:"Skip connection check"`
}

// GetCredentials returns the credentials for AddHAProxyCommand.
func (cmd *AddHAProxyCommand) GetCredentials() error {
creds, err := commands.ReadFromSource(cmd.CredentialsSource)
if err != nil {
Expand All @@ -75,6 +76,7 @@ func (cmd *AddHAProxyCommand) GetCredentials() error {
return nil
}

// RunCmd runs the command for AddHAProxyCommand.
func (cmd *AddHAProxyCommand) RunCmd() (commands.Result, error) {
isSupported, err := helpers.IsHAProxySupported()
if !isSupported {
Expand Down
Loading

0 comments on commit 88a6f18

Please sign in to comment.