Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EntryForwarder ¶
type EntryManager ¶
type EntryManager struct {
// contains filtered or unexported fields
}
EntryManager handles forwarding entries and keeping track of forwarded ports and resources.
func NewEntryManager ¶
func NewEntryManager(out io.Writer, entryForwarder EntryForwarder) *EntryManager
NewEntryManager returns a new port forward entry manager to keep track of forwarded ports and resources
func (*EntryManager) Stop ¶
func (b *EntryManager) Stop()
Stop terminates all kubectl port-forward commands.
func (*EntryManager) Terminate ¶
func (b *EntryManager) Terminate(p *portForwardEntry)
Terminate terminates a single port forward entry
type ForwarderManager ¶
type ForwarderManager struct {
// contains filtered or unexported fields
}
ForwarderManager manages all forwarders
func NewForwarderManager ¶
func NewForwarderManager(out io.Writer, cli *kubectl.CLI, podSelector kubernetes.PodSelector, namespaces []string, label string, opts config.PortForwardOptions, userDefined []*latest.PortForwardResource) *ForwarderManager
NewForwarderManager returns a new port manager which handles starting and stopping port forwarding
func (*ForwarderManager) Start ¶
func (p *ForwarderManager) Start(ctx context.Context) error
Start begins all forwarders managed by the ForwarderManager
func (*ForwarderManager) Stop ¶
func (p *ForwarderManager) Stop()
Stop cleans up and terminates all forwarders managed by the ForwarderManager
type KubectlForwarder ¶
type KubectlForwarder struct {
// contains filtered or unexported fields
}
func NewKubectlForwarder ¶ added in v0.37.0
func NewKubectlForwarder(out io.Writer, cli *kubectl.CLI) *KubectlForwarder
NewKubectlForwarder returns a new KubectlForwarder
func (*KubectlForwarder) Forward ¶
func (k *KubectlForwarder) Forward(parentCtx context.Context, pfe *portForwardEntry)
Forward port-forwards a pod using kubectl port-forward in the background It kills the command on errors in the kubectl port-forward log It restarts the command if it was not cancelled by skaffold It retries in case the port is taken
func (*KubectlForwarder) Terminate ¶
func (*KubectlForwarder) Terminate(p *portForwardEntry)
Terminate terminates an existing kubectl port-forward command using SIGTERM
type ResourceForwarder ¶
type ResourceForwarder struct {
// contains filtered or unexported fields
}
ResourceForwarder is responsible for forwarding user defined port forwarding resources and automatically forwarding services deployed by skaffold.
func NewResourceForwarder ¶
func NewResourceForwarder(entryManager *EntryManager, namespaces []string, label string, userDefinedResources []*latest.PortForwardResource) *ResourceForwarder
NewResourceForwarder returns a struct that tracks and port-forwards services as they are created and modified
func (*ResourceForwarder) Start ¶
func (p *ResourceForwarder) Start(ctx context.Context) error
Start gets a list of services deployed by skaffold as []latest.PortForwardResource and forwards them.
func (*ResourceForwarder) Stop ¶ added in v1.7.1
func (p *ResourceForwarder) Stop()
type WatchingPodForwarder ¶
type WatchingPodForwarder struct {
// contains filtered or unexported fields
}
WatchingPodForwarder is responsible for selecting pods satisfying a certain condition and port-forwarding the exposed container ports within those pods. It also tracks and manages the port-forward connections.
func NewWatchingPodForwarder ¶
func NewWatchingPodForwarder(entryManager *EntryManager, podSelector kubernetes.PodSelector, namespaces []string) *WatchingPodForwarder
NewWatchingPodForwarder returns a struct that tracks and port-forwards pods as they are created and modified
func (*WatchingPodForwarder) Start ¶
func (p *WatchingPodForwarder) Start(ctx context.Context) error
func (*WatchingPodForwarder) Stop ¶ added in v1.7.1
func (p *WatchingPodForwarder) Stop()