Skip to content

Commit

Permalink
Add clusterctl permission and remove clusterctl init
Browse files Browse the repository at this point in the history
  • Loading branch information
Jont828 committed Jan 18, 2023
1 parent 84dd953 commit d86c2bd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion controllers/helmchartproxy/helmchartproxy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (r *HelmChartProxyReconciler) SetupWithManager(ctx context.Context, mgr ctr
//+kubebuilder:rbac:groups=addons.cluster.x-k8s.io,resources=helmreleaseproxies,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=cluster.x-k8s.io,resources=clusters,verbs=list;watch
//+kubebuilder:rbac:groups=controlplane.cluster.x-k8s.io,resources=kubeadmcontrolplanes,verbs=list;get;watch
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io;bootstrap.cluster.x-k8s.io;controlplane.cluster.x-k8s.io,resources=*,verbs=get;list;watch
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io;bootstrap.cluster.x-k8s.io;controlplane.cluster.x-k8s.io;clusterctl.cluster.x-k8s.io,resources=*,verbs=get;list;watch
//+kubebuilder:rbac:groups="",resources=namespaces,verbs=list;

// Reconcile is part of the main kubernetes reconciliation loop which aims to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (r *HelmReleaseProxyReconciler) SetupWithManager(ctx context.Context, mgr c
//+kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;watch
//+kubebuilder:rbac:groups=cluster.x-k8s.io,resources=secrets,verbs=get;list;watch
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io;bootstrap.cluster.x-k8s.io;controlplane.cluster.x-k8s.io,resources=*,verbs=get;list;watch
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io;bootstrap.cluster.x-k8s.io;controlplane.cluster.x-k8s.io;clusterctl.cluster.x-k8s.io,resources=*,verbs=get;list;watch

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
Expand Down
6 changes: 0 additions & 6 deletions internal/cluster_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,6 @@ func GetClusterKubeconfig(ctx context.Context, cluster *clusterv1.Cluster) (stri
return "", err
}

// TODO: Remove this, we don't want to reinstall CAPI on the management cluster.
_, err = c.Init(client.InitOptions{Kubeconfig: client.Kubeconfig(*managementKubeconfig)})
if err != nil {
return "", err
}

options := client.GetKubeconfigOptions{
Kubeconfig: client.Kubeconfig(*managementKubeconfig),
// Kubeconfig: client.Kubeconfig{Path: gk.kubeconfig, Context: gk.kubeconfigContext},
Expand Down

0 comments on commit d86c2bd

Please sign in to comment.