Documentation ¶
Index ¶
- func DebugFactory(f *Factory, ns string, gvr string)
- func DumpFactory(f *Factory)
- type Factory
- func (f *Factory) AddForwarder(pf Forwarder)
- func (f *Factory) CanForResource(ns, gvr string, verbs []string) (informers.GenericInformer, error)
- func (f *Factory) Client() client.Connection
- func (f *Factory) DeleteForwarder(path string)
- func (f *Factory) FactoryFor(ns string) di.DynamicSharedInformerFactory
- func (f *Factory) ForResource(ns, gvr string) (informers.GenericInformer, error)
- func (f *Factory) ForwarderFor(path string) (Forwarder, bool)
- func (f *Factory) Forwarders() Forwarders
- func (f *Factory) Get(gvr, fqn string, wait bool, sel labels.Selector) (runtime.Object, error)
- func (f *Factory) HasSynced(gvr, ns string) (bool, error)
- func (f *Factory) List(gvr, ns string, wait bool, labels labels.Selector) ([]runtime.Object, error)
- func (f *Factory) SetActiveNS(ns string) error
- func (f *Factory) Start(ns string)
- func (f *Factory) Terminate()
- func (f *Factory) ValidatePortForwards()
- func (f *Factory) WaitForCacheSync()
- type Forwarder
- type Forwarders
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory tracks various resource informers.
func NewFactory ¶
func NewFactory(client client.Connection) *Factory
NewFactory returns a new informers factory.
func (*Factory) AddForwarder ¶
AddForwarder registers a new portforward for a given container.
func (*Factory) CanForResource ¶
CanForResource return an informer is user has access.
func (*Factory) Client ¶
func (f *Factory) Client() client.Connection
Client return the factory connection.
func (*Factory) DeleteForwarder ¶
DeleteForwarder deletes portforward for a given container.
func (*Factory) FactoryFor ¶
func (f *Factory) FactoryFor(ns string) di.DynamicSharedInformerFactory
FactoryFor returns a factory for a given namespace.
func (*Factory) ForResource ¶
func (f *Factory) ForResource(ns, gvr string) (informers.GenericInformer, error)
ForResource returns an informer for a given resource.
func (*Factory) ForwarderFor ¶
ForwarderFor returns a portforward for a given container or nil if none exists.
func (*Factory) Forwarders ¶
func (f *Factory) Forwarders() Forwarders
Forwarders returns all portforwards.
func (*Factory) SetActiveNS ¶
SetActiveNS sets the active namespace.
func (*Factory) Terminate ¶
func (f *Factory) Terminate()
Terminate terminates all watchers and forwards.
func (*Factory) ValidatePortForwards ¶ added in v0.21.0
func (f *Factory) ValidatePortForwards()
BOZO!! Review!!! ValidatePortForwards check if pods are still around for portforwards.
func (*Factory) WaitForCacheSync ¶
func (f *Factory) WaitForCacheSync()
WaitForCacheSync waits for all factories to update their cache.
type Forwarder ¶
type Forwarder interface { // Start starts a port-forward. Start(path string, tunnel port.PortTunnel) (*portforward.PortForwarder, error) // Stop terminates a port forward. Stop() // ID returns the pf id. ID() string // Path returns a resource FQN. Path() string // Container returns a container name. Container() string // Ports returns the port mapping. Port() string // FQN returns the full port-forward name. FQN() string // Active returns forwarder current state. Active() bool // SetActive sets port-forward state. SetActive(bool) // Age returns forwarder age. Age() string // HasPortMapping returns true if port mapping exists. HasPortMapping(string) bool }
Forwarder represents a port forwarder.
type Forwarders ¶
Forwarders tracks active port forwards.
func (Forwarders) DeleteAll ¶
func (ff Forwarders) DeleteAll()
DeleteAll stops and delete all port-forwards.
func (Forwarders) IsContainerForwarded ¶ added in v0.21.0
func (ff Forwarders) IsContainerForwarded(path, co string) bool
IsContainerForwarded checks if pod has a forward.
func (Forwarders) IsPodForwarded ¶ added in v0.21.0
func (ff Forwarders) IsPodForwarded(path string) bool
BOZO!! Review!!! IsPodForwarded checks if pod has a forward.
func (Forwarders) Kill ¶
func (ff Forwarders) Kill(path string) int
Kill stops and delete a port-forwards associated with pod.