supervisorproxy

package
v10.145.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package supervisorproxy package implements the supervisor interface and forwards the requests on this interface to a remote supervisor over an rpc call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestSupervisorLauncher

func NewTestSupervisorLauncher() supervisor.Supervisor

NewTestSupervisorLauncher creates a mock supervisor

Types

type ProxyInfo

type ProxyInfo struct {
	ExcludedIPs []string

	sync.Mutex
	// contains filtered or unexported fields
}

ProxyInfo is a struct used to store state for the remote launcher. it mirrors what is stored by the supervisor and also information to talk with the remote enforcer

func NewProxySupervisor

func NewProxySupervisor(collector collector.EventCollector, enforcer enforcer.Enforcer, rpchdl rpcwrapper.RPCClient) (*ProxyInfo, error)

NewProxySupervisor creates a new IptablesSupervisor launcher

func (*ProxyInfo) AddExcludedIPs

func (s *ProxyInfo) AddExcludedIPs(ips []string) error

AddExcludedIPs call addexcluded ip on the remote supervisor

func (*ProxyInfo) CleanUp

func (s *ProxyInfo) CleanUp() error

CleanUp implements the cleanup interface

func (*ProxyInfo) EnableIPTablesPacketTracing

func (s *ProxyInfo) EnableIPTablesPacketTracing(ctx context.Context, contextID string, interval time.Duration) error

EnableIPTablesPacketTracing enable iptables tracing

func (*ProxyInfo) InitRemoteSupervisor

func (s *ProxyInfo) InitRemoteSupervisor(contextID string, puInfo *policy.PUInfo) error

InitRemoteSupervisor calls initsupervisor method on the remote

func (*ProxyInfo) Run

func (s *ProxyInfo) Run(ctx context.Context) error

Run runs the proxy supervisor and initializes the cleaners.

func (*ProxyInfo) SetTargetNetworks

func (s *ProxyInfo) SetTargetNetworks(networks []string) error

SetTargetNetworks sets the target networks in case of an update

func (*ProxyInfo) Supervise

func (s *ProxyInfo) Supervise(contextID string, puInfo *policy.PUInfo) error

Supervise Calls Supervise on the remote supervisor

func (*ProxyInfo) Unsupervise

func (s *ProxyInfo) Unsupervise(contextID string) error

Unsupervise exported stops enforcing policy for the given IP.

type TestSupervisorLauncher

type TestSupervisorLauncher interface {
	supervisor.Supervisor
}

TestSupervisorLauncher is a mock

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL