Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>
  • Loading branch information
hugoShaka and sclevine authored Dec 4, 2024
1 parent 3c71861 commit 7791545
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/web/autoupdate_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (h *Handler) autoUpdateAgentShouldUpdate(ctx context.Context, group, update
return getTriggerFromChannel(ctx, h.cfg.AutomaticUpgradesChannels, group)
}
// Something is broken, we don't want to fallback to channels, this would be harmful.
return false, trace.Wrap(err, "Failed to get auto-update rollout")
return false, trace.Wrap(err, "failed to get auto-update rollout")
}

return getTriggerFromRollout(rollout, group, updaterUUID)
Expand Down Expand Up @@ -115,7 +115,7 @@ func getVersionFromRollout(
autoupdatepb.AutoUpdateAgentGroupState_AUTO_UPDATE_AGENT_GROUP_STATE_DONE:
return rollout.GetSpec().GetTargetVersion(), nil
default:
return "", trace.NotImplemented("Unsupported group state %q", group.GetState())
return "", trace.NotImplemented("unsupported group state %q", group.GetState())
}
}

Expand Down Expand Up @@ -208,8 +208,7 @@ func (h *Handler) getTriggerFromWindowThenChannel(ctx context.Context, groupName
})

// If we have a CMC, we check if the window is active, else we just check if the update is critical.
if err == nil {
if cmc.WithinUpgradeWindow(h.clock.Now()) {
if err == nil && cmc.WithinUpgradeWindow(h.clock.Now()) {
return true, nil
}
}
Expand Down

0 comments on commit 7791545

Please sign in to comment.