Skip to content

Commit 7e0c0a2

Browse files
committed
ci: fix linter errors
Change-Id: Ibda8f39393b6df90b98bc82e2a005a506830ce00 Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent a2afc35 commit 7e0c0a2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

cli/vpndaemon_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/coder/serpent"
1111
)
1212

13-
func (r *RootCmd) vpnDaemonRun() *serpent.Command {
13+
func (*RootCmd) vpnDaemonRun() *serpent.Command {
1414
var (
1515
rpcReadFD int64
1616
rpcWriteFD int64

provisioner/terraform/resources.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -702,20 +702,21 @@ func ConvertState(ctx context.Context, modules []*tfjson.StateModule, rawGraph s
702702
if attrs.ResourceID != "" {
703703
// Look for a resource with matching ID
704704
foundLabels := labelsByResourceID[attrs.ResourceID]
705-
if len(foundLabels) == 1 {
705+
switch len(foundLabels) {
706+
case 0:
707+
// If we couldn't find by ID, fall back to graph traversal
708+
logger.Warn(ctx, "coder_metadata resource_id not found, falling back to graph traversal",
709+
slog.F("resource_id", attrs.ResourceID),
710+
slog.F("metadata_address", resource.Address))
711+
case 1:
706712
// Single match - use it
707713
targetLabel = foundLabels[0]
708-
} else if len(foundLabels) > 1 {
714+
default:
709715
// Multiple resources with same ID - this creates ambiguity
710716
logger.Warn(ctx, "multiple resources found with same resource_id, falling back to graph traversal",
711717
slog.F("resource_id", attrs.ResourceID),
712718
slog.F("metadata_address", resource.Address),
713719
slog.F("matching_labels", foundLabels))
714-
} else {
715-
// If we couldn't find by ID, fall back to graph traversal
716-
logger.Warn(ctx, "coder_metadata resource_id not found, falling back to graph traversal",
717-
slog.F("resource_id", attrs.ResourceID),
718-
slog.F("metadata_address", resource.Address))
719720
}
720721
}
721722

0 commit comments

Comments
 (0)