Skip to content

Commit edc8020

Browse files
committed
Remove redundant GetRESTConfig in KCP Management.GetWorkloadCluster
Signed-off-by: Stefan Büringer [email protected]
1 parent 2e0acc6 commit edc8020

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

controlplane/kubeadm/internal/cluster.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,26 +112,11 @@ func (m *Management) GetWorkloadCluster(ctx context.Context, clusterKey client.O
112112
restConfig = rest.CopyConfig(restConfig)
113113
restConfig.Timeout = 30 * time.Second
114114

115-
if m.Tracker == nil {
116-
return nil, errors.New("Cannot get WorkloadCluster: No remote Cluster Cache")
117-
}
118-
119115
c, err := m.Tracker.GetClient(ctx, clusterKey)
120116
if err != nil {
121117
return nil, &RemoteClusterConnectionError{Name: clusterKey.String(), Err: err}
122118
}
123119

124-
clientConfig, err := m.Tracker.GetRESTConfig(ctx, clusterKey)
125-
if err != nil {
126-
return nil, &RemoteClusterConnectionError{Name: clusterKey.String(), Err: err}
127-
}
128-
129-
// Make sure we use the same CA and Host as the client.
130-
// Note: This has to be done to be able to communicate directly on self-hosted clusters.
131-
restConfig.CAData = clientConfig.CAData
132-
restConfig.CAFile = clientConfig.CAFile
133-
restConfig.Host = clientConfig.Host
134-
135120
// Retrieves the etcd CA key Pair
136121
crtData, keyData, err := m.getEtcdCAKeyPair(ctx, clusterKey)
137122
if err != nil {

0 commit comments

Comments
 (0)