Merge pull request #12976 from spowelljr/outputTunnelHasStarted

Output tunnel has started message so users aren't confused if tunnel is running
pull/12979/head
Medya Ghazizadeh 2021-11-17 16:05:18 -08:00 committed by GitHub
commit 355fe0e2bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -33,7 +33,9 @@ import (
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/mustload"
"k8s.io/minikube/pkg/minikube/out"
"k8s.io/minikube/pkg/minikube/reason"
"k8s.io/minikube/pkg/minikube/style"
"k8s.io/minikube/pkg/minikube/tunnel"
"k8s.io/minikube/pkg/minikube/tunnel/kic"
)
@ -86,6 +88,7 @@ var tunnelCmd = &cobra.Command{
sshPort := strconv.Itoa(port)
sshKey := filepath.Join(localpath.MiniPath(), "machines", cname, "id_rsa")
outputTunnelStarted()
kicSSHTunnel := kic.NewSSHTunnel(ctx, sshPort, sshKey, clientset.CoreV1(), clientset.NetworkingV1())
err = kicSSHTunnel.Start()
if err != nil {
@ -103,6 +106,13 @@ var tunnelCmd = &cobra.Command{
},
}
func outputTunnelStarted() {
out.Styled(style.Success, "Tunnel successfully started")
out.Ln("")
out.Styled(style.Notice, "NOTE: Please do not close this terminal as this process must stay alive for the tunnel to be accessible ...")
out.Ln("")
}
func init() {
tunnelCmd.Flags().BoolVarP(&cleanup, "cleanup", "c", true, "call with cleanup=true to remove old tunnels")
}