Skip to content

Commit

Permalink
fix: set proper type for cluster api kubeconfig secret
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Rose authored and johannesfrey committed Feb 3, 2025
1 parent 77ae2b0 commit b07f82b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions controllers/vcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ type ClientConfigGetter interface {
NewForConfig(restConfig *rest.Config) (kubernetes.Interface, error)
}

type clientConfigGetter struct {
}
type clientConfigGetter struct{}

func (c *clientConfigGetter) NewForConfig(restConfig *rest.Config) (kubernetes.Interface, error) {
return kubernetes.NewForConfig(restConfig)
Expand All @@ -71,8 +70,7 @@ type HTTPClientGetter interface {
ClientFor(r http.RoundTripper, timeout time.Duration) *http.Client
}

type httpClientGetter struct {
}
type httpClientGetter struct{}

func (h *httpClientGetter) ClientFor(r http.RoundTripper, timeout time.Duration) *http.Client {
return &http.Client{
Expand Down Expand Up @@ -414,12 +412,11 @@ func (r *VClusterReconciler) syncVClusterKubeconfig(ctx context.Context, vCluste
},
},
Type: clusterv1beta1.ClusterSecretType,
Data: map[string][]byte{
KubeconfigDataName: outKubeConfig,
},
}
_, err = controllerutil.CreateOrPatch(ctx, r.Client, kubeSecret, func() error {
if kubeSecret.Data == nil {
kubeSecret.Data = make(map[string][]byte)
}
kubeSecret.Data[KubeconfigDataName] = outKubeConfig
return nil
})
if err != nil {
Expand Down

0 comments on commit b07f82b

Please sign in to comment.