Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForwardPorts ¶
func ForwardPorts( conf *rest.Config, namespace string, podName string, portMapping []string, stopChan <-chan struct{}, errChan chan error, timeout time.Duration, ) error
ForwardPorts spawns a goroutine that does the equivalent of "kubectl port-forward -n <namespace> <podName> [portMapping]". The connection will remain open until stopChan is closed. Use errChan for receiving errors from the port-forward goroutine.
Example:
stopCh := make(chan struct{}, 1) errCh := make(chan error) if err = ForwardPorts(conf, "my-ns", "my-pod", []string{"5000:5000"}, stopCh, errCh, time.Minute); err != nil { return err } defer func() { close(stopCh) close(errCh) }()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.