@@ -76,7 +76,7 @@ type EMLB struct {
76
76
client * lbaas.APIClient
77
77
metro string
78
78
projectID string
79
- tokenExchanger * TokenExchanger
79
+ TokenExchanger * TokenExchanger
80
80
}
81
81
82
82
// NewEMLB creates a new Equinix Metal Load Balancer API client object.
@@ -86,7 +86,7 @@ func NewEMLB(metalAPIKey, projectID, metro string) *EMLB {
86
86
emlbConfig .Debug = checkDebugEnabled ()
87
87
88
88
manager .client = lbaas .NewAPIClient (emlbConfig )
89
- manager .tokenExchanger = & TokenExchanger {
89
+ manager .TokenExchanger = & TokenExchanger {
90
90
metalAPIKey : metalAPIKey ,
91
91
tokenExchangeURL : loadbalancerTokenExchnageURL ,
92
92
client : manager .client .GetConfig ().HTTPClient ,
@@ -286,31 +286,31 @@ func (e *EMLB) DeleteLoadBalancerOrigin(ctx context.Context, machineScope *scope
286
286
287
287
// GetLoadBalancers returns a Load Balancer Collection of all the Equinix Metal Load Balancers in a project.
288
288
func (e * EMLB ) GetLoadBalancers (ctx context.Context ) (* lbaas.LoadBalancerCollection , * http.Response , error ) {
289
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
289
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
290
290
291
291
LoadBalancerCollection , resp , err := e .client .ProjectsApi .ListLoadBalancers (ctx , e .projectID ).Execute ()
292
292
return LoadBalancerCollection , resp , err
293
293
}
294
294
295
295
// GetLoadBalancerPools returns a Load Balancer Collection of all the Equinix Metal Load Balancers in a project.
296
296
func (e * EMLB ) GetLoadBalancerPools (ctx context.Context ) (* lbaas.LoadBalancerPoolCollection , * http.Response , error ) {
297
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
297
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
298
298
299
299
LoadBalancerPoolCollection , resp , err := e .client .ProjectsApi .ListPools (ctx , e .projectID ).Execute ()
300
300
return LoadBalancerPoolCollection , resp , err
301
301
}
302
302
303
303
// getLoadBalancer Returns a Load Balancer object given an id.
304
304
func (e * EMLB ) getLoadBalancer (ctx context.Context , id string ) (* lbaas.LoadBalancer , * http.Response , error ) {
305
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
305
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
306
306
307
307
LoadBalancer , resp , err := e .client .LoadBalancersApi .GetLoadBalancer (ctx , id ).Execute ()
308
308
return LoadBalancer , resp , err
309
309
}
310
310
311
311
// getLoadBalancerPort Returns a Load Balancer Port object given an id.
312
312
func (e * EMLB ) getLoadBalancerPort (ctx context.Context , id string , portNumber int32 ) (* lbaas.LoadBalancerPort , error ) {
313
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
313
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
314
314
315
315
LoadBalancerPort , _ , err := e .client .PortsApi .GetLoadBalancerPort (ctx , id , portNumber ).Execute ()
316
316
return LoadBalancerPort , err
@@ -319,7 +319,7 @@ func (e *EMLB) getLoadBalancerPort(ctx context.Context, id string, portNumber in
319
319
// EnsureLoadBalancerOrigin takes the devices list of IP addresses in a Load Balancer Origin Pool and ensures an origin
320
320
// for the first IPv4 address in the list exists.
321
321
func (e * EMLB ) ensureLoadBalancerOrigin (ctx context.Context , originID , poolID , lbName string , deviceAddr []corev1.NodeAddress ) (* lbaas.LoadBalancerPoolOrigin , error ) {
322
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
322
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
323
323
log := ctrl .LoggerFrom (ctx )
324
324
325
325
if originID == "" {
@@ -372,7 +372,7 @@ func (e *EMLB) ensureLoadBalancerOrigin(ctx context.Context, originID, poolID, l
372
372
373
373
// ensureLoadBalancerPool checks if the poolID exists and if not, creates it.
374
374
func (e * EMLB ) ensureLoadBalancerPool (ctx context.Context , poolID , lbName string ) (* lbaas.LoadBalancerPool , error ) {
375
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
375
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
376
376
377
377
// Pool doesn't exist, so let's create it.
378
378
if poolID == "" {
@@ -391,7 +391,7 @@ func (e *EMLB) ensureLoadBalancerPool(ctx context.Context, poolID, lbName string
391
391
392
392
// ensureLoadBalancer Takes a Load Balancer id and ensures those pools and ensures it exists.
393
393
func (e * EMLB ) ensureLoadBalancer (ctx context.Context , lbID , lbname string , portNumber int32 ) (* lbaas.LoadBalancer , * lbaas.LoadBalancerPort , error ) {
394
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
394
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
395
395
396
396
// EMLB doesn't exist, so let's create it.
397
397
if lbID == "" {
@@ -470,18 +470,18 @@ func (e *EMLB) createOrigin(ctx context.Context, poolID, originName string, targ
470
470
471
471
// DeleteLoadBalancer deletes an Equinix Metal Load Balancer given an ID.
472
472
func (e * EMLB ) DeleteLoadBalancer (ctx context.Context , lbID string ) (* http.Response , error ) {
473
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
473
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
474
474
return e .client .LoadBalancersApi .DeleteLoadBalancer (ctx , lbID ).Execute ()
475
475
}
476
476
477
477
// DeleteLoadBalancerPool deletes an Equinix Metal Load Balancer Origin Pool given an ID.
478
478
func (e * EMLB ) DeleteLoadBalancerPool (ctx context.Context , poolID string ) (* http.Response , error ) {
479
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
479
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
480
480
return e .client .PoolsApi .DeleteLoadBalancerPool (ctx , poolID ).Execute ()
481
481
}
482
482
483
483
func (e * EMLB ) updateListenerPort (ctx context.Context , poolID , lbPortID string ) (* lbaas.LoadBalancerPort , error ) {
484
- ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .tokenExchanger )
484
+ ctx = context .WithValue (ctx , lbaas .ContextOAuth2 , e .TokenExchanger )
485
485
486
486
// Create a listener port update request that adds the provided load balancer origin pool to the listener port.
487
487
portUpdateRequest := lbaas.LoadBalancerPortUpdate {
0 commit comments