Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminapetersen committed Mar 31, 2023
1 parent d9b5b15 commit dc7be06
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions cmd/cli/plugin/cluster/kubeconfig_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ func getPinnipedKubeconfig(tkgctlClient tkgctl.TKGClient, workloadClusterName st
audience = *clusterPinnipedInfo.ClusterAudience
}

kubeconfig, err := pinnipedkubeconfig.GetPinnipedKubeconfig(clusterPinnipedInfo.ClusterInfo, clusterPinnipedInfo.PinnipedInfo,
clusterPinnipedInfo.ClusterName, audience)
kubeconfig, err := pinnipedkubeconfig.GetPinnipedKubeconfig(
clusterPinnipedInfo.ClusterInfo,
clusterPinnipedInfo.PinnipedInfo,
clusterPinnipedInfo.ClusterName,
audience,
)

if err != nil {
return errors.Wrap(err, "unable to get kubeconfig")
Expand Down
2 changes: 2 additions & 0 deletions cmd/cli/plugin/login/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ func getDiscoveryHTTPClient() *http.Client {

func vSphereSupervisorLogin(endpoint string) (mergeFilePath, currentContext string, err error) {
port := 443
// TODO(BEN): this func is trickier, it has more dependencies on things that we likely don't
// want to pull into <TF>/pinniped-components/common.
kubeConfig, kubecontext, err := tkgauth.KubeconfigWithPinnipedAuthLoginPlugin(endpoint, nil, tkgauth.DiscoveryStrategy{DiscoveryPort: &port, ClusterInfoConfigMap: wcpauth.SupervisorVIPConfigMapName})
if err != nil {
log.Fatalf("Error creating kubeconfig with tanzu pinniped-auth login plugin: %v", err)
Expand Down
8 changes: 6 additions & 2 deletions cmd/cli/plugin/managementcluster/kubeconfig_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ func getPinnipedKubeconfig(tkgctlClient tkgctl.TKGClient, mcClustername string)
// for management cluster the audience would be set to IssuerURL
audience := clusterPinnipedInfo.PinnipedInfo.Issuer

kubeconfig, _ := pinnipedkubeconfig.GetPinnipedKubeconfig(clusterPinnipedInfo.ClusterInfo, clusterPinnipedInfo.PinnipedInfo,
clusterPinnipedInfo.ClusterName, audience)
kubeconfig, _ := pinnipedkubeconfig.GetPinnipedKubeconfig(
clusterPinnipedInfo.ClusterInfo,
clusterPinnipedInfo.PinnipedInfo,
clusterPinnipedInfo.ClusterName,
audience,
)

kubeconfigbytes, err := json.Marshal(kubeconfig)
if err != nil {
Expand Down

0 comments on commit dc7be06

Please sign in to comment.