Skip to content

Commit 99c7268

Browse files
committed
lint
1 parent 86bb8ae commit 99c7268

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

internal/controller/linodefirewall_controller_helpers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var (
3737

3838
func findObjectsForAddressSet(logger logr.Logger, tracedClient client.Client) handler.MapFunc {
3939
logger = logger.WithName("LinodeFirewallReconciler").WithName("findObjectsForAddressSet")
40-
return func(ctx context.Context, o client.Object) []ctrl.Request {
40+
return func(ctx context.Context, obj client.Object) []ctrl.Request {
4141
ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout)
4242
defer cancel()
4343

@@ -62,7 +62,7 @@ func findObjectsForAddressSet(logger logr.Logger, tracedClient client.Client) ha
6262
for _, item := range firewalls.Items {
6363
for _, inboundRule := range item.Spec.InboundRules {
6464
for _, addrSetRef := range inboundRule.AddressSetRefs {
65-
if addrSetRef.Name == o.GetName() && addrSetRef.Namespace == o.GetNamespace() {
65+
if addrSetRef.Name == obj.GetName() && addrSetRef.Namespace == obj.GetNamespace() {
6666
requestSet[reconcile.Request{
6767
NamespacedName: types.NamespacedName{
6868
Name: item.GetName(),
@@ -74,7 +74,7 @@ func findObjectsForAddressSet(logger logr.Logger, tracedClient client.Client) ha
7474
}
7575
for _, outboundRule := range item.Spec.OutboundRules {
7676
for _, addrSetRef := range outboundRule.AddressSetRefs {
77-
if addrSetRef.Name == o.GetName() && addrSetRef.Namespace == o.GetNamespace() {
77+
if addrSetRef.Name == obj.GetName() && addrSetRef.Namespace == obj.GetNamespace() {
7878
requestSet[reconcile.Request{
7979
NamespacedName: types.NamespacedName{
8080
Name: item.GetName(),

internal/controller/linodefirewall_controller_helpers_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/google/go-cmp/cmp/cmpopts"
1111
"github.com/linode/linodego"
1212
"github.com/stretchr/testify/assert"
13+
"github.com/stretchr/testify/require"
1314

1415
infrav1alpha2 "github.com/linode/cluster-api-provider-linode/api/v1alpha2"
1516
)
@@ -535,7 +536,7 @@ func TestProcessInboundRule(t *testing.T) {
535536
logger := logr.Logger{}
536537
for _, rule := range tt.firewall.Spec.InboundRules {
537538
err := processInboundRule(context.Background(), k8sClient, logger, rule, tt.firewall, tt.createOpts)
538-
assert.NoError(t, err)
539+
require.NoError(t, err)
539540
if !reflect.DeepEqual(tt.createOpts, tt.want) {
540541
t.Errorf("processInboundRule() = %v, want %v", tt.createOpts, tt.want)
541542
}
@@ -605,7 +606,7 @@ func TestProcessOutboundRule(t *testing.T) {
605606
logger := logr.Logger{}
606607
for _, rule := range tt.firewall.Spec.OutboundRules {
607608
err := processOutboundRule(context.Background(), k8sClient, logger, rule, tt.firewall, tt.createOpts)
608-
assert.NoError(t, err)
609+
require.NoError(t, err)
609610
if !reflect.DeepEqual(tt.createOpts, tt.want) {
610611
t.Errorf("processOutboundRule() = %v, want %v", tt.createOpts, tt.want)
611612
}

0 commit comments

Comments
 (0)