66 "net/netip"
77
88 "github.com/go-logr/logr"
9- "github.com/stackitcloud/stackit-sdk-go/services/iaas"
9+ iaas "github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api "
1010
1111 "github.com/stackitcloud/gardener-extension-provider-stackit/v2/pkg/stackit"
1212 stackitclient "github.com/stackitcloud/gardener-extension-provider-stackit/v2/pkg/stackit/client"
@@ -20,8 +20,8 @@ func (r *Resources) reconcileSecurityGroup(ctx context.Context, log logr.Logger)
2020 if r .SecurityGroup == nil {
2121 var err error
2222 r .SecurityGroup , err = r .IaaS .CreateSecurityGroup (ctx , iaas.CreateSecurityGroupPayload {
23- Name : new ( r.ResourceName ) ,
24- Labels : new ( stackit.ToLabels (r.Labels ) ),
23+ Name : r .ResourceName ,
24+ Labels : stackit .ToLabels (r .Labels ),
2525
2626 Description : new ("Security group for Bastion " + r .Bastion.Name ),
2727 })
@@ -61,7 +61,7 @@ func (o *Options) determineWantedSecurityGroupRules() ([]iaas.SecurityGroupRule,
6161 // DHCP tells us our IP and the route to the metadata server
6262 Description : new ("Allow DHCP requests "),
6363
64- Direction : new ( stackit.DirectionEgress ) ,
64+ Direction : stackit .DirectionEgress ,
6565 Ethertype : new (stackit.EtherTypeIPv4 ),
6666 Protocol : new (stackit.ProtocolUDP ),
6767 PortRange : iaas .NewPortRange (68 , 67 ),
@@ -71,7 +71,7 @@ func (o *Options) determineWantedSecurityGroupRules() ([]iaas.SecurityGroupRule,
7171 {
7272 Description : new ("Allow egress to metadata server "),
7373
74- Direction : new ( stackit.DirectionEgress ) ,
74+ Direction : stackit .DirectionEgress ,
7575 Ethertype : new (stackit.EtherTypeIPv4 ),
7676 Protocol : new (stackit.ProtocolTCP ),
7777 PortRange : iaas .NewPortRange (80 , 80 ),
@@ -81,7 +81,7 @@ func (o *Options) determineWantedSecurityGroupRules() ([]iaas.SecurityGroupRule,
8181 {
8282 Description : new (fmt.Sprintf ("Allow egress from Bastion %s to %s worker nodes" , o .Bastion .Name , o .TechnicalID )),
8383
84- Direction : new ( stackit.DirectionEgress ) ,
84+ Direction : stackit .DirectionEgress ,
8585 Ethertype : new (stackit.EtherTypeIPv4 ),
8686 Protocol : new (stackit.ProtocolTCP ),
8787 PortRange : portRangeSSH ,
@@ -95,7 +95,7 @@ func (o *Options) determineWantedSecurityGroupRules() ([]iaas.SecurityGroupRule,
9595 rules = append (rules , iaas.SecurityGroupRule {
9696 Description : new (fmt.Sprintf ("Allow ingress to Bastion %s from world" , o .Bastion .Name )),
9797
98- Direction : new ( stackit.DirectionIngress ) ,
98+ Direction : stackit .DirectionIngress ,
9999 Ethertype : new (stackit.EtherTypeIPv4 ),
100100 Protocol : new (stackit.ProtocolTCP ),
101101 PortRange : portRangeSSH ,
@@ -120,7 +120,7 @@ func (o *Options) determineWantedSecurityGroupRules() ([]iaas.SecurityGroupRule,
120120 rules = append (rules , iaas.SecurityGroupRule {
121121 Description : new (fmt.Sprintf ("Allow ingress to Bastion %s from %s" , o .Bastion .Name , normalizedCIDR )),
122122
123- Direction : new ( stackit.DirectionIngress ) ,
123+ Direction : stackit .DirectionIngress ,
124124 Ethertype : new (etherType ),
125125 Protocol : new (stackit.ProtocolTCP ),
126126 PortRange : portRangeSSH ,
@@ -137,7 +137,7 @@ func (r *Resources) reconcileWorkerSecurityGroupRule(ctx context.Context, log lo
137137 wantedRule := iaas.SecurityGroupRule {
138138 Description : new (fmt.Sprintf ("Allow ingress to shoot worker nodes from Bastion %s" , r .Bastion .Name )),
139139
140- Direction : new ( stackit.DirectionIngress ) ,
140+ Direction : stackit .DirectionIngress ,
141141 Ethertype : new (stackit.EtherTypeIPv4 ),
142142 Protocol : new (stackit.ProtocolTCP ),
143143 PortRange : portRangeSSH ,
0 commit comments