Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Amin Arefzadeh <[email protected]>
  • Loading branch information
aminarefzadeh committed Jan 5, 2025
1 parent 46df59e commit 995035d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/util/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func NewCluster(name string, namespaces []string, clusterResources bool, conf *r
return &clst
}

// GetKubePublicEndpoint returns the kubernetes apiserver endpoint as published
// GetKubePublicEndpoint returns the kubernetes apiserver endpoint and certificate authority data as published
// in the kube-public.
func GetKubePublicEndpoint(client kubernetes.Interface) (string, []byte, error) {
clusterInfo, err := client.CoreV1().ConfigMaps("kube-public").Get(context.TODO(), "cluster-info", metav1.GetOptions{})
Expand All @@ -144,7 +144,9 @@ func GetKubePublicEndpoint(client kubernetes.Interface) (string, []byte, error)
return "", nil, stderrors.New("cluster-info kubeconfig does not have any clusters")
}

return config.Clusters[0].Cluster.Server, config.Clusters[0].Cluster.CertificateAuthorityData, nil
endpoint := config.Clusters[0].Cluster.Server
certificateAuthorityData := config.Clusters[0].Cluster.CertificateAuthorityData
return endpoint, certificateAuthorityData, nil
}

type ClusterOptions struct {
Expand Down

0 comments on commit 995035d

Please sign in to comment.