Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
kubeconfig output
Browse files Browse the repository at this point in the history
  • Loading branch information
tedteng committed Jun 27, 2021
1 parent e9aec0e commit 69230f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/cmd/target_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func NewHistoryCmd(targetWriter TargetWriter) *cobra.Command {
var target Target
if val, ok := m[targetInfoGarden]; ok {
appendTarget(&target, targetInfoGarden, val)
kubeconfigPathOutput(targetInfoGarden)
}

if val, ok := m[targetInfoProject]; ok {
Expand All @@ -64,10 +65,12 @@ func NewHistoryCmd(targetWriter TargetWriter) *cobra.Command {

if val, ok := m[targetInfoSeed]; ok {
appendTarget(&target, targetInfoSeed, val)
kubeconfigPathOutput(targetInfoSeed)
}

if val, ok := m[targetInfoShoot]; ok {
appendTarget(&target, targetInfoShoot, val)
kubeconfigPathOutput(targetInfoShoot)
}

if val, ok := m[targetInfoNamespace]; ok {
Expand Down Expand Up @@ -109,3 +112,9 @@ func appendTarget(target *Target, targetKind TargetKind, name string) *Target {
target.Target = append(target.Target, TargetMeta{targetKind, name})
return target
}

func kubeconfigPathOutput(targetKind TargetKind) {
KUBECONFIG = getKubeConfigOfClusterType(targetKind)
fmt.Println(targetKind + ":")
fmt.Println("KUBECONFIG=" + KUBECONFIG)
}

0 comments on commit 69230f0

Please sign in to comment.