Skip to content

Commit

Permalink
remove nolint-staticcheck usage
Browse files Browse the repository at this point in the history
  • Loading branch information
xiujuanx committed Oct 11, 2023
1 parent 4971ae2 commit 0cb27e0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion controllers/vmware/vspherecluster_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (r *ClusterReconciler) reconcileAPIEndpoints(ctx context.Context, clusterCt
clusterCtx.VSphereCluster.Namespace, clusterCtx.VSphereCluster.Name, machine.Name)
}
log = log.WithValues("VSphereMachine", klog.KObj(vsphereMachine))
ctx = ctrl.LoggerInto(ctx, log) //nolint:ineffassign,staticcheck // ensure the logger is up-to-date in ctx, even if we currently don't use ctx below.
ctx = ctrl.LoggerInto(ctx, log) //nolint:ineffassign // ensure the logger is up-to-date in ctx, even if we currently don't use ctx below.

Check failure on line 312 in controllers/vmware/vspherecluster_reconciler.go

View workflow job for this annotation

GitHub Actions / lint

SA4006: this value of `ctx` is never used (staticcheck)

Check failure on line 312 in controllers/vmware/vspherecluster_reconciler.go

View workflow job for this annotation

GitHub Actions / lint

SA4006: this value of `ctx` is never used (staticcheck)

// If the machine has no IP address then skip it.
if vsphereMachine.Status.IPAddr == "" {
Expand Down
2 changes: 1 addition & 1 deletion controllers/vspheredeploymentzone_controller_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (r vsphereDeploymentZoneReconciler) reconcileFailureDomain(ctx context.Cont
}

func (r vsphereDeploymentZoneReconciler) reconcileInfraFailureDomain(ctx context.Context, deploymentZoneCtx *capvcontext.VSphereDeploymentZoneContext, vsphereFailureDomain *infrav1.VSphereFailureDomain, failureDomain infrav1.FailureDomain) error {
if *failureDomain.AutoConfigure { //nolint:staticcheck
if *failureDomain.AutoConfigure {

Check failure on line 88 in controllers/vspheredeploymentzone_controller_domain.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: failureDomain.AutoConfigure is deprecated: This field is going to be removed in a future release. (staticcheck)

Check failure on line 88 in controllers/vspheredeploymentzone_controller_domain.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: failureDomain.AutoConfigure is deprecated: This field is going to be removed in a future release. (staticcheck)
return r.createAndAttachMetadata(ctx, deploymentZoneCtx, vsphereFailureDomain, failureDomain)
}
return r.verifyFailureDomain(ctx, deploymentZoneCtx, vsphereFailureDomain, failureDomain)
Expand Down
8 changes: 4 additions & 4 deletions internal/webhooks/vspherefailuredomain.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ func (webhook *VSphereFailureDomainWebhook) Default(_ context.Context, obj runti
if !ok {
return apierrors.NewBadRequest(fmt.Sprintf("expected a VSphereFailureDomain but got a %T", obj))
}
if typedObj.Spec.Zone.AutoConfigure == nil { //nolint:staticcheck
typedObj.Spec.Zone.AutoConfigure = pointer.Bool(false) //nolint:staticcheck
if typedObj.Spec.Zone.AutoConfigure == nil {

Check failure on line 110 in internal/webhooks/vspherefailuredomain.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: typedObj.Spec.Zone.AutoConfigure is deprecated: This field is going to be removed in a future release. (staticcheck)
typedObj.Spec.Zone.AutoConfigure = pointer.Bool(false)

Check failure on line 111 in internal/webhooks/vspherefailuredomain.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: typedObj.Spec.Zone.AutoConfigure is deprecated: This field is going to be removed in a future release. (staticcheck)
}

if typedObj.Spec.Region.AutoConfigure == nil { //nolint:staticcheck
typedObj.Spec.Region.AutoConfigure = pointer.Bool(false) //nolint:staticcheck
if typedObj.Spec.Region.AutoConfigure == nil {

Check failure on line 114 in internal/webhooks/vspherefailuredomain.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: typedObj.Spec.Region.AutoConfigure is deprecated: This field is going to be removed in a future release. (staticcheck)
typedObj.Spec.Region.AutoConfigure = pointer.Bool(false)

Check failure on line 115 in internal/webhooks/vspherefailuredomain.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: typedObj.Spec.Region.AutoConfigure is deprecated: This field is going to be removed in a future release. (staticcheck)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions internal/webhooks/vspherefailuredomain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func TestVsphereFailureDomain_Default(t *testing.T) {
webhook := &VSphereFailureDomainWebhook{}
g.Expect(webhook.Default(context.Background(), m)).ToNot(HaveOccurred())

g.Expect(*m.Spec.Zone.AutoConfigure).To(BeFalse()) //nolint:staticcheck
g.Expect(*m.Spec.Region.AutoConfigure).To(BeFalse()) //nolint:staticcheck
g.Expect(*m.Spec.Zone.AutoConfigure).To(BeFalse())

Check failure on line 37 in internal/webhooks/vspherefailuredomain_test.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: m.Spec.Zone.AutoConfigure is deprecated: This field is going to be removed in a future release. (staticcheck)
g.Expect(*m.Spec.Region.AutoConfigure).To(BeFalse())

Check failure on line 38 in internal/webhooks/vspherefailuredomain_test.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: m.Spec.Region.AutoConfigure is deprecated: This field is going to be removed in a future release. (staticcheck)
}

func TestVSphereFailureDomain_ValidateCreate(t *testing.T) {
Expand Down

0 comments on commit 0cb27e0

Please sign in to comment.