Skip to content

Commit 220b813

Browse files
authored
🌱 Remove unused method ClientConfigWithAPIEndpoint #1687 (#1688)
Remove unused method ClientConfigWithAPIEndpoint #1687
1 parent 95c1b7f commit 220b813

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

pkg/scope/cluster.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -165,25 +165,6 @@ func (s *ClusterScope) ClientConfig(ctx context.Context) (clientcmd.ClientConfig
165165
return clientcmd.NewClientConfigFromBytes(kubeconfigBytes)
166166
}
167167

168-
// ClientConfigWithAPIEndpoint returns a client config.
169-
func (s *ClusterScope) ClientConfigWithAPIEndpoint(ctx context.Context, endpoint clusterv1.APIEndpoint) (clientcmd.ClientConfig, error) {
170-
c, err := s.ClientConfig(ctx)
171-
if err != nil {
172-
return nil, err
173-
}
174-
175-
raw, err := c.RawConfig()
176-
if err != nil {
177-
return nil, fmt.Errorf("error retrieving rawConfig from clientConfig: %w", err)
178-
}
179-
// update cluster endpint in config
180-
for key := range raw.Clusters {
181-
raw.Clusters[key].Server = fmt.Sprintf("https://%s:%d", endpoint.Host, endpoint.Port)
182-
}
183-
184-
return clientcmd.NewDefaultClientConfig(raw, &clientcmd.ConfigOverrides{}), nil
185-
}
186-
187168
// ListMachines returns HCloudMachines.
188169
func (s *ClusterScope) ListMachines(ctx context.Context) ([]*clusterv1.Machine, []*infrav1.HCloudMachine, error) {
189170
// get and index Machines by HCloudMachine name

0 commit comments

Comments
 (0)