Skip to content

Commit 3e4d91e

Browse files
committed
Resolved linting errors
1 parent 1a006e1 commit 3e4d91e

1 file changed

Lines changed: 0 additions & 92 deletions

File tree

cloud/linode/loadbalancers_test.go

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,98 +2261,6 @@ func testUpdateLoadBalancerUpdateFirewallACL(t *testing.T, client *linodego.Clie
22612261
t.Errorf("expected non nil IPv4, got %v", fwIPs)
22622262
}
22632263

2264-
if len(*fwIPs) != 2 {
2265-
t.Errorf("expected two IPv4 ips, got %v", fwIPs)
2266-
}
2267-
2268-
if firewallsNew[0].Rules.Inbound[0].Addresses.IPv6 == nil {
2269-
t.Errorf("expected non nil IPv6, got %v", firewallsNew[0].Rules.Inbound[0].Addresses.IPv6)
2270-
}
2271-
2272-
if len(*firewallsNew[0].Rules.Inbound[0].Addresses.IPv6) != 2 {
2273-
t.Errorf("expected two IPv6 ips, got %v", firewallsNew[0].Rules.Inbound[0].Addresses.IPv6)
2274-
}
2275-
2276-
// Update ips in allowList
2277-
svc.ObjectMeta.SetAnnotations(map[string]string{
2278-
annotations.AnnLinodeCloudFirewallACL: `{
2279-
"allowList": {
2280-
"ipv4": ["2.2.2.1/32", "3.3.3.3/32"],
2281-
"ipv6": ["dead::/128", "dead:bee::/128"]
2282-
}
2283-
}`,
2284-
})
2285-
2286-
err = lb.UpdateLoadBalancer(context.TODO(), "linodelb", svc, nodes)
2287-
if err != nil {
2288-
t.Errorf("UpdateLoadBalancer returned an error: %s", err)
2289-
}
2290-
2291-
nbUpdated, err = lb.getNodeBalancerByStatus(context.TODO(), svc)
2292-
if err != nil {
2293-
t.Fatalf("failed to get NodeBalancer via status: %s", err)
2294-
}
2295-
2296-
firewallsNew, err = lb.client.ListNodeBalancerFirewalls(context.TODO(), nbUpdated.ID, &linodego.ListOptions{})
2297-
if err != nil {
2298-
t.Fatalf("failed to List Firewalls %s", err)
2299-
}
2300-
2301-
if len(firewallsNew) == 0 {
2302-
t.Fatalf("No attached firewalls found")
2303-
}
2304-
2305-
fwIPs = firewallsNew[0].Rules.Inbound[0].Addresses.IPv4
2306-
if fwIPs == nil {
2307-
t.Errorf("expected non nil IPv4, got %v", fwIPs)
2308-
}
2309-
2310-
if len(*fwIPs) != 2 {
2311-
t.Errorf("expected two IPv4 ips, got %v", fwIPs)
2312-
}
2313-
2314-
if firewallsNew[0].Rules.Inbound[0].Addresses.IPv6 == nil {
2315-
t.Errorf("expected non nil IPv6, got %v", firewallsNew[0].Rules.Inbound[0].Addresses.IPv6)
2316-
}
2317-
2318-
if len(*firewallsNew[0].Rules.Inbound[0].Addresses.IPv6) != 2 {
2319-
t.Errorf("expected two IPv6 ips, got %v", firewallsNew[0].Rules.Inbound[0].Addresses.IPv6)
2320-
}
2321-
2322-
// remove one ipv4 and one ipv6 ip from allowList
2323-
svc.ObjectMeta.SetAnnotations(map[string]string{
2324-
annotations.AnnLinodeCloudFirewallACL: `{
2325-
"allowList": {
2326-
"ipv4": ["3.3.3.3/32"],
2327-
"ipv6": ["dead:beef::/128"]
2328-
}
2329-
}`,
2330-
})
2331-
2332-
err = lb.UpdateLoadBalancer(context.TODO(), "linodelb", svc, nodes)
2333-
if err != nil {
2334-
t.Errorf("UpdateLoadBalancer returned an error: %s", err)
2335-
}
2336-
2337-
nbUpdated, err = lb.getNodeBalancerByStatus(context.TODO(), svc)
2338-
if err != nil {
2339-
t.Fatalf("failed to get NodeBalancer via status: %s", err)
2340-
}
2341-
2342-
firewallsNew, err = lb.client.ListNodeBalancerFirewalls(context.TODO(), nbUpdated.ID, &linodego.ListOptions{})
2343-
if err != nil {
2344-
t.Fatalf("failed to List Firewalls %s", err)
2345-
}
2346-
2347-
if len(firewallsNew) == 0 {
2348-
t.Fatalf("No attached firewalls found")
2349-
}
2350-
2351-
fwIPs = firewallsNew[0].Rules.Inbound[0].Addresses.IPv4
2352-
if fwIPs == nil {
2353-
t.Errorf("expected non nil IPv4, got %v", fwIPs)
2354-
}
2355-
23562264
if len(*fwIPs) != 1 {
23572265
t.Errorf("expected one IPv4, got %v", fwIPs)
23582266
}

0 commit comments

Comments
 (0)