diff --git a/cloud/linode/instances.go b/cloud/linode/instances.go index da0da983..26c762d0 100644 --- a/cloud/linode/instances.go +++ b/cloud/linode/instances.go @@ -107,7 +107,7 @@ func (i *instances) lookupLinode(ctx context.Context, node *v1.Node) (*linodego. sentry.SetTag(ctx, "provider_id", providerID) sentry.SetTag(ctx, "node_name", node.Name) - if providerID != "" && isLinodeProviderID(providerID){ + if providerID != "" && isLinodeProviderID(providerID) { id, err := parseProviderID(providerID) if err != nil { sentry.CaptureError(ctx, err) diff --git a/cloud/linode/loadbalancers.go b/cloud/linode/loadbalancers.go index 25ddcfa5..704e5653 100644 --- a/cloud/linode/loadbalancers.go +++ b/cloud/linode/loadbalancers.go @@ -251,7 +251,7 @@ func (l *loadbalancers) getNodeBalancerDeviceId(ctx context.Context, firewallID, func (l *loadbalancers) updateNodeBalancerFirewall(ctx context.Context, service *v1.Service, nb *linodego.NodeBalancer) error { var newFirewallID, existingFirewallID int var err error - fwid, ok := getServiceAnnotation(service, annLinodeCloudFirewallID) + fwid, ok := service.GetAnnotations()[annLinodeCloudFirewallID] if ok { newFirewallID, err = strconv.Atoi(fwid) if err != nil { diff --git a/cloud/linode/loadbalancers_test.go b/cloud/linode/loadbalancers_test.go index 4b31f2a4..4114a312 100644 --- a/cloud/linode/loadbalancers_test.go +++ b/cloud/linode/loadbalancers_test.go @@ -762,7 +762,7 @@ func testUpdateLoadBalancerAddNewFirewall(t *testing.T, client *linodego.Client, svc := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ - Name: randString(10), + Name: randString(), UID: "foobar123", Annotations: map[string]string{ annLinodeThrottle: "15", @@ -771,7 +771,7 @@ func testUpdateLoadBalancerAddNewFirewall(t *testing.T, client *linodego.Client, Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{ { - Name: randString(10), + Name: randString(), Protocol: "TCP", Port: int32(80), NodePort: int32(30000), @@ -871,7 +871,7 @@ func testUpdateLoadBalancerUpdateFirewall(t *testing.T, client *linodego.Client, svc := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ - Name: randString(10), + Name: randString(), UID: "foobar123", Annotations: map[string]string{ annLinodeThrottle: "15", @@ -880,7 +880,7 @@ func testUpdateLoadBalancerUpdateFirewall(t *testing.T, client *linodego.Client, Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{ { - Name: randString(10), + Name: randString(), Protocol: "TCP", Port: int32(80), NodePort: int32(30000), @@ -984,7 +984,7 @@ func testUpdateLoadBalancerDeleteFirewall(t *testing.T, client *linodego.Client, svc := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ - Name: randString(10), + Name: randString(), UID: "foobar123", Annotations: map[string]string{ annLinodeThrottle: "15", @@ -993,7 +993,7 @@ func testUpdateLoadBalancerDeleteFirewall(t *testing.T, client *linodego.Client, Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{ { - Name: randString(10), + Name: randString(), Protocol: "TCP", Port: int32(80), NodePort: int32(30000),