Skip to content

Commit 058c8f0

Browse files
rahulaiteljohnson92
authored andcommitted
use label for filtering if vpcid is not set
1 parent 54184a9 commit 058c8f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/controller/linodevpc_controller_helpers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ func reconcileVPC(ctx context.Context, vpcScope *scope.VPCScope, logger logr.Log
4747
ID: vpcScope.LinodeVPC.Spec.VPCID,
4848
Tags: nil,
4949
}
50+
// If VPCID is not set, we should use the label to filter
51+
if vpcScope.LinodeVPC.Spec.VPCID == nil {
52+
listFilter.Label = vpcScope.LinodeVPC.Name
53+
}
5054
filter, err := listFilter.String()
5155
if err != nil {
5256
return err

0 commit comments

Comments
 (0)