Skip to content

Commit cfcc999

Browse files
author
Liam Cervante
committed
make linter happy
1 parent b594089 commit cfcc999

File tree

2 files changed

+28
-31
lines changed

2 files changed

+28
-31
lines changed

internal/stacks/stackruntime/internal/stackeval/stack.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -764,24 +764,22 @@ Instance:
764764
}
765765
}
766766

767-
if removeds != nil {
768-
for _, removed := range removeds {
769-
insts, unknown, _ := removed.Instances(ctx, PlanPhase)
770-
if unknown {
771-
// We can't determine if the component is targeted or not. This
772-
// is okay, as any changes to this component will be deferred
773-
// anyway and a follow up plan will then detect the missing
774-
// component if it exists.
775-
continue Instance
776-
}
767+
for _, removed := range removeds {
768+
insts, unknown, _ := removed.Instances(ctx, PlanPhase)
769+
if unknown {
770+
// We can't determine if the component is targeted or not. This
771+
// is okay, as any changes to this component will be deferred
772+
// anyway and a follow up plan will then detect the missing
773+
// component if it exists.
774+
continue Instance
775+
}
777776

778-
for _, i := range insts {
779-
// the instance key for a removed block doesn't always translate
780-
// directly into the instance key in the address, so we have
781-
// to check for the correct one.
782-
if i.from.Item.Key == inst.Item.Key {
783-
continue Instance
784-
}
777+
for _, i := range insts {
778+
// the instance key for a removed block doesn't always translate
779+
// directly into the instance key in the address, so we have
780+
// to check for the correct one.
781+
if i.from.Item.Key == inst.Item.Key {
782+
continue Instance
785783
}
786784
}
787785
}

internal/stacks/stackruntime/internal/stackeval/walk_dynamic.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,18 @@ func walkDynamicObjectsInStack[Output any](
144144

145145
claimedInstances := collections.NewSet[stackaddrs.ComponentInstance]()
146146
removed := stack.Removed(ctx, component.Addr().Item)
147-
if removed != nil {
148-
for _, block := range removed {
149-
// In this case we don't care about the unknown. If the
150-
// removed instances are unknown, then we'll mark
151-
// everything as being part of the component block. So,
152-
// even if insts comes back as unknown and hence empty,
153-
// we still proceed as normal.
154-
insts, _, _ := block.Instances(ctx, phase)
155-
for key := range insts {
156-
claimedInstances.Add(stackaddrs.ComponentInstance{
157-
Component: component.Addr().Item,
158-
Key: key,
159-
})
160-
}
147+
for _, block := range removed {
148+
// In this case we don't care about the unknown. If the
149+
// removed instances are unknown, then we'll mark
150+
// everything as being part of the component block. So,
151+
// even if insts comes back as unknown and hence empty,
152+
// we still proceed as normal.
153+
insts, _, _ := block.Instances(ctx, phase)
154+
for key := range insts {
155+
claimedInstances.Add(stackaddrs.ComponentInstance{
156+
Component: component.Addr().Item,
157+
Key: key,
158+
})
161159
}
162160
}
163161

@@ -297,6 +295,7 @@ func walkDynamicObjectsInStack[Output any](
297295
if componentInstances.Has(inst.Addr().Item) {
298296
// this is an error, but it should have been raised
299297
// elsewhere
298+
continue
300299
}
301300
claimedInstances.Add(inst.Addr().Item)
302301
mutex.Unlock()

0 commit comments

Comments
 (0)