Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sclevine committed Oct 29, 2024
1 parent 6e32ad8 commit 7c53b9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/autoupdate/agent/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ func (w *lineLogger) Write(p []byte) (n int, err error) {
}

// Newline found, log line
w.log.Log(w.ctx, w.level, w.last.String()) //nolint:sloglint
w.log.Log(w.ctx, w.level, w.last.String()) //nolint:sloglint // msg cannot be constant
n += w.last.Len() + 1
w.last.Reset()

// Log lines that are already newline-terminated
for _, line := range lines[:len(lines)-1] {
w.log.Log(w.ctx, w.level, string(line)) //nolint:sloglint
w.log.Log(w.ctx, w.level, string(line)) //nolint:sloglint // msg cannot be constant
n += len(line) + 1
}

Expand All @@ -170,6 +170,6 @@ func (w *lineLogger) Flush() {
if w.last.Len() == 0 {
return
}
w.log.Log(w.ctx, w.level, w.last.String()) //nolint:sloglint
w.log.Log(w.ctx, w.level, w.last.String()) //nolint:sloglint // msg cannot be constant
w.last.Reset()
}
4 changes: 2 additions & 2 deletions lib/autoupdate/agent/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func (u *Updater) Enable(ctx context.Context, override OverrideConfig) error {

if err := u.Process.Sync(ctx); err != nil {
if errors.Is(err, context.Canceled) {
return trace.Errorf("sync cancelled")
return trace.Errorf("sync canceled")
}
// If sync fails, we may have left the host in a bad state, so we revert linking and re-Sync.
u.Log.ErrorContext(ctx, "Reverting symlinks due to invalid configuration.")
Expand All @@ -341,7 +341,7 @@ func (u *Updater) Enable(ctx context.Context, override OverrideConfig) error {
u.Log.InfoContext(ctx, "Target version successfully installed.", "version", desiredVersion)
if err := u.Process.Reload(ctx); err != nil && !errors.Is(err, ErrNotNeeded) {
if errors.Is(err, context.Canceled) {
return trace.Errorf("reload cancelled")
return trace.Errorf("reload canceled")
}
// If reloading Teleport at the new version fails, revert, resync, and reload.
u.Log.ErrorContext(ctx, "Reverting symlinks due to failed restart.")
Expand Down

0 comments on commit 7c53b9b

Please sign in to comment.