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 ¶
func (f *Factory) ValidatePortForwards()
ValidatePortForwards check if pods are still around for portforwards. BOZO!! Review!!!
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 // Container returns a container name. Container() string // Port returns the port mapping. Port() string // Address returns the host address. Address() 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() time.Time // 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 ¶
func (ff Forwarders) IsContainerForwarded(fqn, co string) bool
IsContainerForwarded checks if pod has a forward.
func (Forwarders) IsPodForwarded ¶
func (ff Forwarders) IsPodForwarded(fqn string) bool
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.