@@ -76,7 +76,7 @@ type EMLB struct {
7676 client * lbaas.APIClient
7777 metro string
7878 projectID string
79- tokenExchanger * TokenExchanger
79+ TokenExchanger * TokenExchanger
8080}
8181
8282// NewEMLB creates a new Equinix Metal Load Balancer API client object.
@@ -86,7 +86,7 @@ func NewEMLB(metalAPIKey, projectID, metro string) *EMLB {
8686 emlbConfig .Debug = checkDebugEnabled ()
8787
8888 manager .client = lbaas .NewAPIClient (emlbConfig )
89- manager .tokenExchanger = & TokenExchanger {
89+ manager .TokenExchanger = & TokenExchanger {
9090 metalAPIKey : metalAPIKey ,
9191 tokenExchangeURL : loadbalancerTokenExchnageURL ,
9292 client : manager .client .GetConfig ().HTTPClient ,
@@ -286,31 +286,31 @@ func (e *EMLB) DeleteLoadBalancerOrigin(ctx context.Context, machineScope *scope
286286
287287// GetLoadBalancers returns a Load Balancer Collection of all the Equinix Metal Load Balancers in a project.
288288func (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 )
290290
291291 LoadBalancerCollection , resp , err := e .client .ProjectsApi .ListLoadBalancers (ctx , e .projectID ).Execute ()
292292 return LoadBalancerCollection , resp , err
293293}
294294
295295// GetLoadBalancerPools returns a Load Balancer Collection of all the Equinix Metal Load Balancers in a project.
296296func (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 )
298298
299299 LoadBalancerPoolCollection , resp , err := e .client .ProjectsApi .ListPools (ctx , e .projectID ).Execute ()
300300 return LoadBalancerPoolCollection , resp , err
301301}
302302
303303// getLoadBalancer Returns a Load Balancer object given an id.
304304func (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 )
306306
307307 LoadBalancer , resp , err := e .client .LoadBalancersApi .GetLoadBalancer (ctx , id ).Execute ()
308308 return LoadBalancer , resp , err
309309}
310310
311311// getLoadBalancerPort Returns a Load Balancer Port object given an id.
312312func (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 )
314314
315315 LoadBalancerPort , _ , err := e .client .PortsApi .GetLoadBalancerPort (ctx , id , portNumber ).Execute ()
316316 return LoadBalancerPort , err
@@ -319,7 +319,7 @@ func (e *EMLB) getLoadBalancerPort(ctx context.Context, id string, portNumber in
319319// EnsureLoadBalancerOrigin takes the devices list of IP addresses in a Load Balancer Origin Pool and ensures an origin
320320// for the first IPv4 address in the list exists.
321321func (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 )
323323 log := ctrl .LoggerFrom (ctx )
324324
325325 if originID == "" {
@@ -372,7 +372,7 @@ func (e *EMLB) ensureLoadBalancerOrigin(ctx context.Context, originID, poolID, l
372372
373373// ensureLoadBalancerPool checks if the poolID exists and if not, creates it.
374374func (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 )
376376
377377 // Pool doesn't exist, so let's create it.
378378 if poolID == "" {
@@ -391,7 +391,7 @@ func (e *EMLB) ensureLoadBalancerPool(ctx context.Context, poolID, lbName string
391391
392392// ensureLoadBalancer Takes a Load Balancer id and ensures those pools and ensures it exists.
393393func (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 )
395395
396396 // EMLB doesn't exist, so let's create it.
397397 if lbID == "" {
@@ -470,18 +470,18 @@ func (e *EMLB) createOrigin(ctx context.Context, poolID, originName string, targ
470470
471471// DeleteLoadBalancer deletes an Equinix Metal Load Balancer given an ID.
472472func (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 )
474474 return e .client .LoadBalancersApi .DeleteLoadBalancer (ctx , lbID ).Execute ()
475475}
476476
477477// DeleteLoadBalancerPool deletes an Equinix Metal Load Balancer Origin Pool given an ID.
478478func (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 )
480480 return e .client .PoolsApi .DeleteLoadBalancerPool (ctx , poolID ).Execute ()
481481}
482482
483483func (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 )
485485
486486 // Create a listener port update request that adds the provided load balancer origin pool to the listener port.
487487 portUpdateRequest := lbaas.LoadBalancerPortUpdate {
0 commit comments