Skip to content

Commit 2961808

Browse files
committed
fix linting issues
1 parent ade8f58 commit 2961808

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

internal/controllers/managedcontrolplane/controller.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121

2222
"github.com/openmcp-project/controller-utils/pkg/clusters"
2323
"github.com/openmcp-project/controller-utils/pkg/conditions"
24-
"github.com/openmcp-project/controller-utils/pkg/controller"
2524
ctrlutils "github.com/openmcp-project/controller-utils/pkg/controller"
2625
"github.com/openmcp-project/controller-utils/pkg/controller/smartrequeue"
2726
errutils "github.com/openmcp-project/controller-utils/pkg/errors"
@@ -135,9 +134,9 @@ func (r *ManagedControlPlaneReconciler) reconcile(ctx context.Context, req recon
135134
// doing this here means that only the 'interesting' cases of backoff and reset have to be handled in the reconcile logic
136135
if rr.Object != nil {
137136
if rr.ReconcileError != nil {
138-
r.sr.For(rr.Object).Error(rr.ReconcileError)
137+
r.sr.For(rr.Object).Error(rr.ReconcileError) //nolint:errcheck
139138
} else if rr.Result.IsZero() {
140-
r.sr.For(rr.Object).Never()
139+
r.sr.For(rr.Object).Never() //nolint:errcheck
141140
}
142141
}
143142
return rr
@@ -153,7 +152,7 @@ func (r *ManagedControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) error
153152
return nil
154153
}
155154
return []ctrl.Request{testutils.RequestFromObject(obj)}
156-
}), controller.ToTypedPredicate[*corev2alpha1.ManagedControlPlane](predicate.And(
155+
}), ctrlutils.ToTypedPredicate[*corev2alpha1.ManagedControlPlane](predicate.And(
157156
predicate.Or(
158157
predicate.GenerationChangedPredicate{},
159158
ctrlutils.DeletionTimestampChangedPredicate{},
@@ -176,7 +175,7 @@ func (r *ManagedControlPlaneReconciler) handleCreateOrUpdate(ctx context.Context
176175
OldObject: mcp.DeepCopy(),
177176
Conditions: []metav1.Condition{},
178177
}
179-
createCon := controller.GenerateCreateConditionFunc(&rr)
178+
createCon := ctrlutils.GenerateCreateConditionFunc(&rr)
180179

181180
// ensure that the ClusterRequest exists
182181
// since ClusterRequests are basically immutable, updating it is not required
@@ -226,9 +225,9 @@ func (r *ManagedControlPlaneReconciler) handleCreateOrUpdate(ctx context.Context
226225
oidcProviders = append(oidcProviders, defaultOidc)
227226
}
228227
oidcProviders = append(oidcProviders, mcp.Spec.IAM.OIDCProviders...)
229-
for _, oidc := range mcp.Spec.IAM.OIDCProviders {
228+
for _, oidc := range oidcProviders {
230229
log.Debug("Creating/updating AccessRequest for OIDC provider", "oidcProviderName", oidc.Name)
231-
arName := controller.K8sNameHash(mcp.Name, oidc.Name)
230+
arName := ctrlutils.K8sNameHash(mcp.Name, oidc.Name)
232231
ar := &clustersv1alpha1.AccessRequest{}
233232
ar.Name = arName
234233
ar.Namespace = namespace
@@ -366,7 +365,7 @@ func (r *ManagedControlPlaneReconciler) handleCreateOrUpdate(ctx context.Context
366365
return rr
367366
}
368367
mcpSecret := &corev1.Secret{}
369-
mcpSecret.Name = controller.K8sNameHash(mcp.Name, providerName)
368+
mcpSecret.Name = ctrlutils.K8sNameHash(mcp.Name, providerName)
370369
mcpSecret.Namespace = mcp.Namespace
371370
if _, err := controllerutil.CreateOrUpdate(ctx, r.OnboardingCluster.Client(), mcpSecret, func() error {
372371
mcpSecret.Data = arSecret.Data

0 commit comments

Comments
 (0)