Skip to content

Commit

Permalink
fix review findings
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Sep 18, 2023
1 parent ec92d06 commit b08a5e6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ linters:
- govet
- importas
- ineffassign
- loggercheck
- misspell
- nakedret
- nilerr
Expand Down
2 changes: 1 addition & 1 deletion controllers/clustermodule_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewReconciler(controllerManagerCtx *capvcontext.ControllerManagerContext) R

func (r Reconciler) Reconcile(ctx context.Context, clusterCtx *capvcontext.ClusterContext) (reconcile.Result, error) {
log := ctrl.LoggerFrom(ctx)
log.Info("Reconcile cluster modules")
log.Info("Reconciling cluster modules")

if !clustermodule.IsClusterCompatible(clusterCtx) {
conditions.MarkFalse(clusterCtx.VSphereCluster, infrav1.ClusterModulesAvailableCondition, infrav1.VCenterVersionIncompatibleReason, clusterv1.ConditionSeverityInfo,
Expand Down
2 changes: 1 addition & 1 deletion controllers/serviceaccount_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func (r *ServiceAccountReconciler) syncServiceAccountSecret(ctx context.Context,
if len(svcAccountTokenSecret.Data) == 0 {
// Note: We don't have to requeue here because we have a watch on the secret and the cluster should be reconciled
// when a secret has token data populated.
log.Info("Skipping sync secret for provider service account: secret has no data", "secret", secretName)
log.Info("Skipping sync secret for provider service account: secret has no data", "Secret", klog.KRef(pSvcAccount.Namespace, secretName))
return nil
}

Expand Down
5 changes: 2 additions & 3 deletions controllers/servicediscovery_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,8 @@ func (r *serviceDiscoveryReconciler) reconcileSupervisorHeadlessService(ctx cont
)
default:
log.Error(
fmt.Errorf(
"unexpected result during createOrPatch k8s service endpoints",
),
nil,
"unexpected result during createOrPatch k8s service endpoints",

Check warning on line 300 in controllers/servicediscovery_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/servicediscovery_controller.go#L298-L300

Added lines #L298 - L300 were not covered by tests
"endpointsKey",
endpointsKey,
"endpointsSubsets",
Expand Down
4 changes: 2 additions & 2 deletions controllers/vmware/vspherecluster_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (r *ClusterReconciler) reconcileNormal(ctx context.Context, clusterCtx *vmw
}

clusterCtx.VSphereCluster.Status.Ready = true
log.V(2).Info("Reconcile completed, VSphereCluster is ready")
log.V(2).Info("Reconciling completed, VSphereCluster is ready")
return nil
}

Expand Down Expand Up @@ -349,7 +349,7 @@ func (r *ClusterReconciler) VSphereMachineToCluster(ctx context.Context, o clien

vsphereMachine, ok := o.(*vmwarev1.VSphereMachine)
if !ok {
log.Error(errors.New("did not get vspheremachine"), "got", fmt.Sprintf("%T", o))
log.Error(nil, fmt.Sprintf("expected a VSphereMachine but got a %T", o))

Check warning on line 352 in controllers/vmware/vspherecluster_reconciler.go

View check run for this annotation

Codecov / codecov/patch

controllers/vmware/vspherecluster_reconciler.go#L352

Added line #L352 was not covered by tests
return nil
}
log = log.WithValues("VSphereMachine", klog.KObj(vsphereMachine))
Expand Down
1 change: 0 additions & 1 deletion controllers/vspherecluster_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ func (r *clusterReconciler) setOwnerRefsOnVsphereMachines(ctx context.Context, c
return kerrors.NewAggregate(patchErrors)
}

// TODO: zhanggbj: Add golang context after refactoring ClusterModule controller and reconciler.
func (r *clusterReconciler) reconcileClusterModules(ctx context.Context, clusterCtx *capvcontext.ClusterContext) (reconcile.Result, error) {
if feature.Gates.Enabled(feature.NodeAntiAffinity) {
return r.clusterModuleReconciler.Reconcile(ctx, clusterCtx)

Check warning on line 560 in controllers/vspherecluster_reconciler.go

View check run for this annotation

Codecov / codecov/patch

controllers/vspherecluster_reconciler.go#L560

Added line #L560 was not covered by tests
Expand Down

0 comments on commit b08a5e6

Please sign in to comment.