Skip to content

Commit

Permalink
fix: crossnamespace remotecluster reference is not supported (#163)
Browse files Browse the repository at this point in the history
* Update kamajicontrolplane_controller_externalreference.go

* Update kamajicontrolplane_controller_externalreference.go
  • Loading branch information
sachinphogat authored Jan 17, 2025
1 parent 5858271 commit ee29426
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ var (

//nolint:cyclop
func (r *KamajiControlPlaneReconciler) extractRemoteClient(ctx context.Context, kcp v1alpha1.KamajiControlPlane) (client.Client, error) { //nolint:ireturn
if !r.FeatureGates.Enabled(features.ExternalClusterReference) &&
!r.FeatureGates.Enabled(features.ExternalClusterReferenceCrossNamespace) {
if !r.FeatureGates.Enabled(features.ExternalClusterReference) {

Check failure on line 34 in controllers/kamajicontrolplane_controller_externalreference.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/clastix/cluster-api-control-plane-provider-kamaji) (gci)
return nil, ErrExternalClusterReferenceNotEnabled
}

if r.FeatureGates.Enabled(features.ExternalClusterReference) &&
if r.FeatureGates.Enabled(features.ExternalClusterReference) &&

Check failure on line 38 in controllers/kamajicontrolplane_controller_externalreference.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/clastix/cluster-api-control-plane-provider-kamaji) (gci)
!r.FeatureGates.Enabled(features.ExternalClusterReferenceCrossNamespace) &&
kcp.Spec.Deployment.ExternalClusterReference.KubeconfigSecretNamespace != "" &&
kcp.Spec.Deployment.ExternalClusterReference.KubeconfigSecretNamespace != kcp.Namespace {
return nil, ErrExternalClusterReferenceCrossNamespaceReference
Expand Down

0 comments on commit ee29426

Please sign in to comment.