Skip to content

Commit

Permalink
Fix linter warning and import order
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
  • Loading branch information
alexander-demicev committed Jan 8, 2025
1 parent 3325dd0 commit 694ecd1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package controllers
import (
"context"
"fmt"
"sigs.k8s.io/cluster-api/util/certs"
"strings"
"time"

Expand Down Expand Up @@ -50,16 +49,17 @@ import (
"sigs.k8s.io/cluster-api/controllers/remote"
"sigs.k8s.io/cluster-api/util"
"sigs.k8s.io/cluster-api/util/annotations"
"sigs.k8s.io/cluster-api/util/certs"
"sigs.k8s.io/cluster-api/util/collections"
"sigs.k8s.io/cluster-api/util/conditions"
capikubeconfig "sigs.k8s.io/cluster-api/util/kubeconfig"
"sigs.k8s.io/cluster-api/util/patch"

controlplanev1 "github.com/rancher/cluster-api-provider-rke2/controlplane/api/v1beta1"
"github.com/rancher/cluster-api-provider-rke2/pkg/kubeconfig"
"github.com/rancher/cluster-api-provider-rke2/pkg/registration"
"github.com/rancher/cluster-api-provider-rke2/pkg/rke2"
"github.com/rancher/cluster-api-provider-rke2/pkg/secret"
capikubeconfig "sigs.k8s.io/cluster-api/util/kubeconfig"
)

const (
Expand Down Expand Up @@ -826,8 +826,8 @@ func (r *RKE2ControlPlaneReconciler) reconcileKubeconfig(

if needsRotation {
logger.Info("Rotating kubeconfig secret")
err = kubeconfig.CreateSecretWithOwner(ctx, r.Client, clusterName, endpoint.String(), controllerOwnerRef)
if err != nil {

if err := kubeconfig.CreateSecretWithOwner(ctx, r.Client, clusterName, endpoint.String(), controllerOwnerRef); err != nil {
return ctrl.Result{}, errors.Wrap(err, "failed to regenerate kubeconfig")
}
}
Expand Down

0 comments on commit 694ecd1

Please sign in to comment.