@@ -27,6 +27,9 @@ import (
2727)
2828
2929func SecurityGroupFilterToListOpts (securityGroupFilter * infrav1.SecurityGroupFilter ) securitygroups.ListOpts {
30+ if securityGroupFilter == nil {
31+ return securitygroups.ListOpts {}
32+ }
3033 return securitygroups.ListOpts {
3134 ID : securityGroupFilter .ID ,
3235 Name : securityGroupFilter .Name ,
@@ -40,6 +43,9 @@ func SecurityGroupFilterToListOpts(securityGroupFilter *infrav1.SecurityGroupFil
4043}
4144
4245func SubnetFilterToListOpts (subnetFilter * infrav1.SubnetFilter ) subnets.ListOpts {
46+ if subnetFilter == nil {
47+ return subnets.ListOpts {}
48+ }
4349 return subnets.ListOpts {
4450 Name : subnetFilter .Name ,
4551 Description : subnetFilter .Description ,
@@ -58,6 +64,9 @@ func SubnetFilterToListOpts(subnetFilter *infrav1.SubnetFilter) subnets.ListOpts
5864}
5965
6066func NetworkFilterToListOpts (networkFilter * infrav1.NetworkFilter ) networks.ListOpts {
67+ if networkFilter == nil {
68+ return networks.ListOpts {}
69+ }
6170 return networks.ListOpts {
6271 Name : networkFilter .Name ,
6372 Description : networkFilter .Description ,
@@ -71,6 +80,9 @@ func NetworkFilterToListOpts(networkFilter *infrav1.NetworkFilter) networks.List
7180}
7281
7382func RouterFilterToListOpts (routerFilter * infrav1.RouterFilter ) routers.ListOpts {
83+ if routerFilter == nil {
84+ return routers.ListOpts {}
85+ }
7486 return routers.ListOpts {
7587 ID : routerFilter .ID ,
7688 Name : routerFilter .Name ,
@@ -84,6 +96,9 @@ func RouterFilterToListOpts(routerFilter *infrav1.RouterFilter) routers.ListOpts
8496}
8597
8698func ImageFilterToListOpts (imageFilter * infrav1.ImageFilter ) images.ListOpts {
99+ if imageFilter == nil {
100+ return images.ListOpts {}
101+ }
87102 return images.ListOpts {
88103 ID : imageFilter .ID ,
89104 Name : imageFilter .Name ,
0 commit comments