Skip to content

Commit

Permalink
PMM-12896 Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov committed Mar 14, 2024
1 parent a77e999 commit e003f5c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
10 changes: 9 additions & 1 deletion agent/runner/actions/mongodb_query_admincommand_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ type mongodbQueryAdmincommandAction struct {
}

// NewMongoDBQueryAdmincommandAction creates a MongoDB adminCommand query action.
func NewMongoDBQueryAdmincommandAction(id string, timeout time.Duration, dsn string, files *agentpb.TextFiles, command string, arg interface{}, tempDir string) (Action, error) {
func NewMongoDBQueryAdmincommandAction(
id string,
timeout time.Duration,
dsn string,
files *agentpb.TextFiles,
command string,
arg interface{},
tempDir string,
) (Action, error) {
dsn, err := templates.RenderDSN(dsn, files, filepath.Join(tempDir, strings.ToLower(mongoDBQueryAdminCommandActionType), id))
if err != nil {
return nil, errors.WithStack(err)
Expand Down
7 changes: 6 additions & 1 deletion agent/runner/actions/postgresql_show_create_table_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ type postgresqlShowCreateTableAction struct {

// NewPostgreSQLShowCreateTableAction creates PostgreSQL SHOW CREATE TABLE Action.
// This is an Action that can run `\d+ table` command analog on PostgreSQL service with given DSN.
func NewPostgreSQLShowCreateTableAction(id string, timeout time.Duration, params *agentpb.StartActionRequest_PostgreSQLShowCreateTableParams, tempDir string) (Action, error) {
func NewPostgreSQLShowCreateTableAction(
id string,
timeout time.Duration,
params *agentpb.StartActionRequest_PostgreSQLShowCreateTableParams,
tempDir string,
) (Action, error) {
dsn, err := templates.RenderDSN(params.Dsn, params.TlsFiles, filepath.Join(tempDir, strings.ToLower(postgreSQLShowCreateTableActionType), id))
if err != nil {
return nil, errors.WithStack(err)
Expand Down
4 changes: 2 additions & 2 deletions agent/runner/jobs/pbm_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ func execPBMCommand(ctx context.Context, dsn string, to interface{}, args ...str
nCtx, cancel := context.WithTimeout(ctx, cmdTimeout)
defer cancel()

args = append(args, "--out=json", "--mongodb-uri="+dsn)
cmd := exec.CommandContext(nCtx, pbmBin, args...) // #nosec G204
args = append(args, "--out=json", "--mongodb-uri="+dsn) //nolint:goconst
cmd := exec.CommandContext(nCtx, pbmBin, args...) // #nosec G204

b, err := cmd.Output()
if err != nil {
Expand Down

0 comments on commit e003f5c

Please sign in to comment.