Skip to content

Commit 4fdad7b

Browse files
l-technicoreYashwantGohokar
authored andcommitted
Support for Workload Identity in GetReservedIP calls
New E2E for testing LB & NLB creation with ReserveIP using Workload Identity Resource Principal Fixing a logical issue with the existing Wris E2E cleanup
1 parent 778edae commit 4fdad7b

File tree

2 files changed

+1639
-189
lines changed

2 files changed

+1639
-189
lines changed

pkg/cloudprovider/providers/oci/load_balancer.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ type CloudLoadBalancerProvider struct {
104104
logger *zap.SugaredLogger
105105
metricPusher *metrics.MetricPusher
106106
config *providercfg.Config
107+
ociConfig *client.OCIClientConfig
107108
}
108109

109110
type IpVersions struct {
@@ -141,6 +142,10 @@ func (cp *CloudProvider) getLoadBalancerProvider(ctx context.Context, svc *v1.Se
141142
logger: cp.logger,
142143
metricPusher: cp.metricPusher,
143144
config: cp.config,
145+
ociConfig: &client.OCIClientConfig{
146+
SaToken: serviceAccountToken,
147+
TenancyId: cp.config.Auth.TenancyID,
148+
},
144149
}, nil
145150
}
146151

@@ -425,7 +430,7 @@ func (clb *CloudLoadBalancerProvider) createLoadBalancer(ctx context.Context, sp
425430
}
426431

427432
if spec.LoadBalancerIP != "" {
428-
reservedIpOCID, err := getReservedIpOcidByIpAddress(ctx, spec.LoadBalancerIP, clb.client.Networking(nil))
433+
reservedIpOCID, err := getReservedIpOcidByIpAddress(ctx, spec.LoadBalancerIP, clb.client.Networking(clb.ociConfig))
429434
if err != nil {
430435
return nil, "", err
431436
}

0 commit comments

Comments
 (0)