Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyb89 committed Oct 23, 2024
1 parent 7a40edf commit 934263b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
8 changes: 4 additions & 4 deletions lib/tbot/cli/start_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ type DatabaseCommand struct {
*sharedDestinationArgs
*genericMutatorHandler

Format string
Service string
Username string
Database string
Format string
Service string
Username string
Database string
}

// NewDatabaseCommand initializes a command and flags for database outputs and
Expand Down
2 changes: 1 addition & 1 deletion lib/tbot/cli/start_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type IdentityCommand struct {
*sharedDestinationArgs
*genericMutatorHandler

Cluster string
Cluster string
}

// NewIdentityCommand initializes the command and flags for identity outputs
Expand Down
2 changes: 1 addition & 1 deletion lib/tbot/cli/start_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (s *sharedStartArgs) ApplyConfig(cfg *config.BotConfig, l *slog.Logger) err

// sharedDestinationArgs are arguments common to all commands that accept a
// --destination flag and any related flags. Downstream commands will need to
// call `BuildDestination()` to retreive the value.
// call `BuildDestination()` to retrieve the value.
type sharedDestinationArgs struct {
Destination string
ReaderUsers []string
Expand Down
16 changes: 9 additions & 7 deletions lib/tbot/config/destination_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,13 @@ func (dd *DestinationDirectory) Init(ctx context.Context, subdirs []string) erro
"underlying issue.")
}

const msg = "ACLs were requested but could not be configured, they " +
"will be disabled. To resolve this warning, ensure ACLs are " +
"supported and the directory is owned by the bot user, or " +
"remove any configured readers to disable ACLs"
log.WarnContext(
ctx,
"ACLs were requested but could not be configured, they will be "+
"disabled. To resolve this warning, ensure ACLs are supported "+
"and the directory is owned by the bot user, or remove any "+
"configured readers to disable ACLs",
msg,
"path", dd.Path,
"error", err,
"readers", dd.Readers,
Expand Down Expand Up @@ -322,11 +323,12 @@ func (dd *DestinationDirectory) Verify(keys []string) error {
if len(dd.Readers) > 0 {
// TODO: consider moving ownership check into Init()?
if !ownedByBot {
const msg = "This destination is not owned by the bot user so ACLs " +
"will not be enforced. To silence this warning, fix destination " +
"file ownership or remove configured `readers`"
log.WarnContext(
context.TODO(),
"This destination is not owned by the bot user so ACLs will "+
"not be enforced. To silence this warning, fix destination "+
"file ownership or remove configured `readers`",
msg,
"path", dd.Path,
)

Expand Down
2 changes: 1 addition & 1 deletion lib/tbot/config/destination_directory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"path/filepath"
"testing"

"github.com/gravitational/trace"
"github.com/stretchr/testify/require"

"github.com/gravitational/teleport/lib/tbot/botfs"
"github.com/gravitational/teleport/lib/utils"
"github.com/gravitational/trace"
)

func TestDestinationDirectory_Lock(t *testing.T) {
Expand Down

0 comments on commit 934263b

Please sign in to comment.