Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 634082b

Browse files
committed
make lint; make fmt
Signed-off-by: Danny Kopping <[email protected]>
1 parent b0e9728 commit 634082b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

coderd/notifications/events.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var (
3939
TemplateTemplateDeprecated = uuid.MustParse("f40fae84-55a2-42cd-99fa-b41c1ca64894")
4040

4141
TemplateWorkspaceBuildsFailedReport = uuid.MustParse("34a20db2-e9cc-4a93-b0e4-8569699d7a00")
42-
TemplateWorkspaceResourceReplaced = uuid.MustParse("89d9745a-816e-4695-a17f-3d0a229e2b8d")
42+
TemplateWorkspaceResourceReplaced = uuid.MustParse("89d9745a-816e-4695-a17f-3d0a229e2b8d")
4343
)
4444

4545
// Notification-related events.

coderd/prebuilds/noop.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type NoopReconciler struct{}
1313

1414
func (NoopReconciler) Run(context.Context) {}
1515
func (NoopReconciler) Stop(context.Context, error) {}
16-
func (NoopReconciler) TrackResourceReplacement(ctx context.Context, workspaceID, buildID, claimantID uuid.UUID, replacements []*sdkproto.ResourceReplacement) {
16+
func (NoopReconciler) TrackResourceReplacement(context.Context, uuid.UUID, uuid.UUID, uuid.UUID, []*sdkproto.ResourceReplacement) {
1717
}
1818
func (NoopReconciler) ReconcileAll(context.Context) error { return nil }
1919
func (NoopReconciler) SnapshotState(context.Context, database.Store) (*GlobalSnapshot, error) {

enterprise/coderd/prebuilds/reconcile.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ func (c *StoreReconciler) provision(
632632

633633
func (c *StoreReconciler) TrackResourceReplacement(ctx context.Context, workspaceID, buildID, claimantID uuid.UUID, replacements []*sdkproto.ResourceReplacement) {
634634
// Set authorization context since this may be called in the background (i.e. with a bare context).
635+
// nolint:gocritic // Necessary to query all the required data.
635636
ctx = dbauthz.AsSystemRestricted(ctx)
636637
// Since this may be called in a fire-and-forget fashion, we need to give up at some point.
637638
trackCtx, trackCancel := context.WithTimeout(ctx, time.Minute)
@@ -642,6 +643,7 @@ func (c *StoreReconciler) TrackResourceReplacement(ctx context.Context, workspac
642643
}
643644
}
644645

646+
// nolint:revive // Shut up it's fine.
645647
func (c *StoreReconciler) trackResourceReplacement(ctx context.Context, workspaceID, buildID, claimantID uuid.UUID, replacements []*sdkproto.ResourceReplacement) error {
646648
if err := ctx.Err(); err != nil {
647649
return err
@@ -683,12 +685,12 @@ func (c *StoreReconciler) trackResourceReplacement(ctx context.Context, workspac
683685
// Use the claiming build here (not prebuild) because both should be equivalent, and we might as well spot inconsistencies now.
684686
templateVersion, err := c.store.GetTemplateVersionByID(ctx, build.TemplateVersionID)
685687
if err != nil {
686-
return xerrors.Errorf("fetch template version %q: %w", build.TemplateVersionID.String())
688+
return xerrors.Errorf("fetch template version %q: %w", build.TemplateVersionID.String(), err)
687689
}
688690

689691
org, err := c.store.GetOrganizationByID(ctx, workspace.OrganizationID)
690692
if err != nil {
691-
return xerrors.Errorf("fetch org %q: %w", workspace.OrganizationID.String())
693+
return xerrors.Errorf("fetch org %q: %w", workspace.OrganizationID.String(), err)
692694
}
693695

694696
// Track resource replacement in Prometheus metric.

0 commit comments

Comments
 (0)