Skip to content

Commit 526d8a2

Browse files
committed
address PR comments
1 parent 561f13f commit 526d8a2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/vpc/vpc.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,18 @@ func UseFromClusterStack(ctx context.Context, provider api.ClusterProvider, stac
329329
// if a subnet is present on the stack outputs, but actually missing from VPC
330330
// e.g. it was manually deleted by the user using AWS CLI/Console
331331
// than log a warning and don't import it into cluster spec
332+
stackDriftFound := false
332333
for _, ssID := range stackSubnets {
333334
if !slices.Contains(vpcSubnets, ssID) {
334-
logger.Warning("%s was found on cluster cloudformation stack, but has been removed from %s outside of eksctl", ssID, spec.VPC.ID)
335+
stackDriftFound = true
336+
logger.Warning("%s was found on cluster cloudformation stack outputs, but has been removed from VPC %s outside of eksctl", ssID, spec.VPC.ID)
335337
continue
336338
}
337339
toBeImported = append(toBeImported, ssID)
338340
}
341+
if stackDriftFound {
342+
logger.Warning("VPC %s contains the following subnets: %s", spec.VPC.ID, strings.Join(vpcSubnets, ","))
343+
}
339344
return ImportSubnetsFromIDList(ctx, provider.EC2(), spec, subnetMapping, toBeImported)
340345
}
341346

0 commit comments

Comments
 (0)