Skip to content

Commit e91d60c

Browse files
WIP for image build only
1 parent cf8e71c commit e91d60c

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

controllers/clustercache/cluster_accessor_client.go

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,10 @@ func (ca *clusterAccessor) createConnection(ctx context.Context) (*createConnect
8080

8181
// If the controller runs on the workload cluster, access the apiserver directly by using the
8282
// CA and Host from the in-cluster configuration.
83-
if runningOnCluster {
84-
log.V(6).Info("Controller is running on the cluster, updating REST config with in-cluster config")
85-
86-
inClusterConfig, err := ctrl.GetConfig()
87-
if err != nil {
88-
return nil, errors.Wrapf(err, "error getting in-cluster REST config")
89-
}
90-
91-
// Use CA and Host from in-cluster config.
92-
restConfig.CAData = nil
93-
restConfig.CAFile = inClusterConfig.CAFile
94-
restConfig.Host = inClusterConfig.Host
95-
96-
log.V(6).Info(fmt.Sprintf("Creating HTTP client and mapper with updated REST config with host %q", restConfig.Host))
97-
httpClient, mapper, restClient, err = createHTTPClientAndMapper(ctx, ca.config.HealthProbe, restConfig)
98-
if err != nil {
99-
return nil, errors.Wrapf(err, "error creating HTTP client and mapper (using in-cluster config)")
100-
}
101-
}
83+
// NOTE: In-cluster optimization is DISABLED because it causes authentication issues with managed
84+
// Kubernetes services (EKS, GKE, AKS) that use short-lived tokens.
85+
// TODO: Re-enable with proper detection of cluster type if performance becomes critical.
86+
_ = runningOnCluster // Acknowledge we detect this but don't use it
10287

10388
log.V(6).Info("Creating cached client and cache")
10489
cachedClient, cache, err := createCachedClient(ctx, ca.config, restConfig, httpClient, mapper)

0 commit comments

Comments
 (0)