Skip to content

Commit d0a5612

Browse files
committed
go
1 parent 52cba10 commit d0a5612

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cmd/kubectl.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ func getDebugImage(cmd *cobra.Command) (string, error) {
4343
return "", fmt.Errorf("failed to get kubeconfig flag: %w", err)
4444
}
4545

46-
_, kubeCl, err := utilk8s.SetupK8sClientSet(kubeconfigPath, "")
46+
contextName, err := cmd.Flags().GetString("context")
47+
if err != nil {
48+
return "", fmt.Errorf("failed to get kubeconfig flag: %w", err)
49+
}
50+
51+
fmt.Fprintf(os.Stdout, "kubeconfigPath: %s\n", kubeconfigPath)
52+
fmt.Fprintf(os.Stdout, "contextName: %s\n", contextName)
53+
54+
_, kubeCl, err := utilk8s.SetupK8sClientSet(kubeconfigPath, contextName)
4755
if err != nil {
4856
return "", fmt.Errorf("failed to create Kubernetes client: %w", err)
4957
}

0 commit comments

Comments
 (0)