Skip to content

Commit 5e5d3a1

Browse files
committed
Fix linter complaints
1 parent 84ebffa commit 5e5d3a1

8 files changed

+29
-29
lines changed

api/v1beta1/azurecluster_webhook.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ func (c *AzureCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
4242
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusters,versions=v1beta1,name=default.azurecluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4343

4444
// Default implements webhook.Defaulter so a webhook will be registered for the type.
45-
func (c *AzureCluster) Default(ctx context.Context, obj runtime.Object) error {
45+
func (c *AzureCluster) Default(_ context.Context, _ runtime.Object) error {
4646
c.setDefaults()
4747
return nil
4848
}
4949

5050
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
51-
func (c *AzureCluster) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
51+
func (c *AzureCluster) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
5252
return c.validateCluster(nil)
5353
}
5454

5555
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
56-
func (c *AzureCluster) ValidateUpdate(ctx context.Context, obj runtime.Object, oldRaw runtime.Object) (admission.Warnings, error) {
56+
func (c *AzureCluster) ValidateUpdate(_ context.Context, _ runtime.Object, oldRaw runtime.Object) (admission.Warnings, error) {
5757
var allErrs field.ErrorList
5858
old := oldRaw.(*AzureCluster)
5959

@@ -196,6 +196,6 @@ func (c *AzureCluster) validateSubnetUpdate(old *AzureCluster) field.ErrorList {
196196
}
197197

198198
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
199-
func (c *AzureCluster) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
199+
func (c *AzureCluster) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
200200
return nil, nil
201201
}

api/v1beta1/azureclusteridentity_webhook.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ func (c *AzureClusterIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error {
3939
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclusteridentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusteridentities,versions=v1beta1,name=validation.azureclusteridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4040

4141
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
42-
func (c *AzureClusterIdentity) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
42+
func (c *AzureClusterIdentity) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
4343
return c.validateClusterIdentity()
4444
}
4545

4646
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
47-
func (c *AzureClusterIdentity) ValidateUpdate(ctx context.Context, obj runtime.Object, oldRaw runtime.Object) (admission.Warnings, error) {
47+
func (c *AzureClusterIdentity) ValidateUpdate(_ context.Context, _ runtime.Object, oldRaw runtime.Object) (admission.Warnings, error) {
4848
var allErrs field.ErrorList
4949
old := oldRaw.(*AzureClusterIdentity)
5050
if err := webhookutils.ValidateImmutable(
@@ -60,6 +60,6 @@ func (c *AzureClusterIdentity) ValidateUpdate(ctx context.Context, obj runtime.O
6060
}
6161

6262
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
63-
func (c *AzureClusterIdentity) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
63+
func (c *AzureClusterIdentity) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
6464
return nil, nil
6565
}

api/v1beta1/azureclustertemplate_webhook.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ func (c *AzureClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
4343
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azureclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclustertemplates,versions=v1beta1,name=default.azureclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4444

4545
// Default implements webhook.Defaulter so a webhook will be registered for the type.
46-
func (c *AzureClusterTemplate) Default(ctx context.Context, obj runtime.Object) error {
46+
func (c *AzureClusterTemplate) Default(_ context.Context, _ runtime.Object) error {
4747
c.setDefaults()
4848
return nil
4949
}
5050

5151
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
52-
func (c *AzureClusterTemplate) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
52+
func (c *AzureClusterTemplate) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
5353
return c.validateClusterTemplate()
5454
}
5555

5656
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
57-
func (c *AzureClusterTemplate) ValidateUpdate(ctx context.Context, obj runtime.Object, oldRaw runtime.Object) (admission.Warnings, error) {
57+
func (c *AzureClusterTemplate) ValidateUpdate(_ context.Context, _ runtime.Object, oldRaw runtime.Object) (admission.Warnings, error) {
5858
var allErrs field.ErrorList
5959
old := oldRaw.(*AzureClusterTemplate)
6060
if !reflect.DeepEqual(c.Spec.Template.Spec, old.Spec.Template.Spec) {
@@ -70,6 +70,6 @@ func (c *AzureClusterTemplate) ValidateUpdate(ctx context.Context, obj runtime.O
7070
}
7171

7272
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
73-
func (c *AzureClusterTemplate) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
73+
func (c *AzureClusterTemplate) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
7474
return nil, nil
7575
}

api/v1beta1/azuremanagedcluster_webhook.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ func (r *AzureManagedCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
3535
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcluster,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedclusters,versions=v1beta1,name=validation.azuremanagedclusters.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
3636

3737
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
38-
func (r *AzureManagedCluster) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
38+
func (r *AzureManagedCluster) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
3939
return nil, nil
4040
}
4141

4242
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
43-
func (r *AzureManagedCluster) ValidateUpdate(ctx context.Context, obj runtime.Object, _ runtime.Object) (admission.Warnings, error) {
43+
func (r *AzureManagedCluster) ValidateUpdate(_ context.Context, _ runtime.Object, _ runtime.Object) (admission.Warnings, error) {
4444
return nil, nil
4545
}
4646

4747
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
48-
func (r *AzureManagedCluster) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
48+
func (r *AzureManagedCluster) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
4949
return nil, nil
5050
}

api/v1beta1/azuremanagedclustertemplate_webhook.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ func (r *AzureManagedClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager)
3535
// +kubebuilder:webhook:verbs=update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedclustertemplate,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedclustertemplates,versions=v1beta1,name=validation.azuremanagedclustertemplates.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
3636

3737
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
38-
func (r *AzureManagedClusterTemplate) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
38+
func (r *AzureManagedClusterTemplate) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
3939
return nil, nil
4040
}
4141

4242
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
43-
func (r *AzureManagedClusterTemplate) ValidateUpdate(ctx context.Context, obj runtime.Object, _ runtime.Object) (admission.Warnings, error) {
43+
func (r *AzureManagedClusterTemplate) ValidateUpdate(_ context.Context, _ runtime.Object, _ runtime.Object) (admission.Warnings, error) {
4444
return nil, nil
4545
}
4646

4747
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
48-
func (r *AzureManagedClusterTemplate) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
48+
func (r *AzureManagedClusterTemplate) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
4949
return nil, nil
5050
}

azure/scope/cluster_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestNewClusterScope(t *testing.T) {
103103
},
104104
},
105105
}
106-
azureCluster.Default(context.TODO(), nil)
106+
g.Expect(azureCluster.Default(context.TODO(), nil)).To(Succeed())
107107

108108
fakeIdentity := &infrav1.AzureClusterIdentity{
109109
Spec: infrav1.AzureClusterIdentitySpec{
@@ -230,7 +230,7 @@ func TestAPIServerHost(t *testing.T) {
230230
tc.azureCluster.ObjectMeta = metav1.ObjectMeta{
231231
Name: cluster.Name,
232232
}
233-
tc.azureCluster.Default(context.TODO(), nil)
233+
g.Expect(tc.azureCluster.Default(context.TODO(), nil)).To(Succeed())
234234

235235
clusterScope := &ClusterScope{
236236
Cluster: cluster,
@@ -275,7 +275,7 @@ func TestGettingSecurityRules(t *testing.T) {
275275
},
276276
},
277277
}
278-
azureCluster.Default(context.TODO(), nil)
278+
g.Expect(azureCluster.Default(context.TODO(), nil)).To(Succeed())
279279

280280
clusterScope := &ClusterScope{
281281
Cluster: cluster,
@@ -2161,7 +2161,7 @@ func TestOutboundLBName(t *testing.T) {
21612161
azureCluster.Spec.NetworkSpec.NodeOutboundLB = tc.nodeOutboundLB
21622162
}
21632163

2164-
azureCluster.Default(context.TODO(), nil)
2164+
g.Expect(azureCluster.Default(context.TODO(), nil)).To(Succeed())
21652165

21662166
clusterScope := &ClusterScope{
21672167
AzureCluster: azureCluster,
@@ -2275,7 +2275,7 @@ func TestBackendPoolName(t *testing.T) {
22752275
},
22762276
}
22772277

2278-
azureCluster.Default(context.TODO(), nil)
2278+
g.Expect(azureCluster.Default(context.TODO(), nil)).To(Succeed())
22792279

22802280
if tc.customAPIServerBackendPoolName != "" {
22812281
azureCluster.Spec.NetworkSpec.APIServerLB.BackendPool.Name = tc.customAPIServerBackendPoolName
@@ -2388,7 +2388,7 @@ func TestOutboundPoolName(t *testing.T) {
23882388
}
23892389
}
23902390

2391-
azureCluster.Default(context.TODO(), nil)
2391+
g.Expect(azureCluster.Default(context.TODO(), nil)).To(Succeed())
23922392

23932393
clusterScope := &ClusterScope{
23942394
AzureCluster: azureCluster,

controllers/helpers_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ func TestGetCloudProviderConfig(t *testing.T) {
101101

102102
cluster := newCluster("foo")
103103
azureCluster := newAzureCluster("bar")
104-
azureCluster.Default(context.TODO(), nil)
104+
g.Expect(azureCluster.Default(context.TODO(), nil)).To(Succeed())
105105
azureClusterCustomVnet := newAzureClusterWithCustomVnet("bar")
106-
azureClusterCustomVnet.Default(context.TODO(), nil)
106+
g.Expect(azureClusterCustomVnet.Default(context.TODO(), nil)).To(Succeed())
107107

108108
cases := map[string]struct {
109109
cluster *clusterv1.Cluster
@@ -301,7 +301,7 @@ func TestReconcileAzureSecret(t *testing.T) {
301301
cluster := newCluster("foo")
302302
azureCluster := newAzureCluster("bar")
303303

304-
azureCluster.Default(context.TODO(), nil)
304+
g.Expect(azureCluster.Default(context.TODO(), nil)).To(Succeed())
305305
cluster.Name = "testCluster"
306306

307307
fakeIdentity := &infrav1.AzureClusterIdentity{

exp/api/v1beta1/azuremachinepoolmachine_webhook.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ func (ampm *AzureMachinePoolMachine) SetupWebhookWithManager(mgr ctrl.Manager) e
3636
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinepoolmachine,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremachinepoolmachines,versions=v1beta1,name=azuremachinepoolmachine.kb.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
3737

3838
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
39-
func (ampm *AzureMachinePoolMachine) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
39+
func (ampm *AzureMachinePoolMachine) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
4040
return nil, nil
4141
}
4242

4343
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
44-
func (ampm *AzureMachinePoolMachine) ValidateUpdate(ctx context.Context, obj runtime.Object, old runtime.Object) (admission.Warnings, error) {
44+
func (ampm *AzureMachinePoolMachine) ValidateUpdate(_ context.Context, _ runtime.Object, old runtime.Object) (admission.Warnings, error) {
4545
oldMachine, ok := old.(*AzureMachinePoolMachine)
4646
if !ok {
4747
return nil, errors.New("expected and AzureMachinePoolMachine")
@@ -55,6 +55,6 @@ func (ampm *AzureMachinePoolMachine) ValidateUpdate(ctx context.Context, obj run
5555
}
5656

5757
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
58-
func (ampm *AzureMachinePoolMachine) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
58+
func (ampm *AzureMachinePoolMachine) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
5959
return nil, nil
6060
}

0 commit comments

Comments
 (0)