Documentation ¶
Index ¶
- Variables
- func AppEnvironment(ctx context.Context, ag *agentconfig.Container) (map[string]string, error)
- func Main(ctx context.Context, _ ...string) error
- func StartServices(ctx context.Context, g *dgroup.Group, config Config, srv State) (*rpc.AgentInfo, error)
- func TalkToManager(ctx context.Context, address string, info *rpc.AgentInfo, state State) error
- func TalkToManagerLoop(ctx context.Context, s State, info *rpc.AgentInfo)
- type Config
- type ContainerState
- type InterceptState
- type InterceptTarget
- func (cp InterceptTarget) AgentPort() uint16
- func (cp InterceptTarget) AppProtocol(ctx context.Context) (proto string)
- func (cp InterceptTarget) ContainerPort() uint16
- func (cp InterceptTarget) ContainerPortName() string
- func (cp InterceptTarget) HasServicePort(port uint16) bool
- func (cp InterceptTarget) HasServicePortName(name string) bool
- func (cp InterceptTarget) MatchForSpec(spec *manager.InterceptSpec) bool
- func (cp InterceptTarget) Protocol() v1.Protocol
- func (cp InterceptTarget) String() string
- type ProviderMux
- type State
Constants ¶
This section is empty.
Variables ¶
var DisplayName = "OSS Traffic Agent" //nolint:gochecknoglobals // extension point
var NewExtendedManagerClient func(conn *grpc.ClientConn, ossManager rpc.ManagerClient) rpc.ManagerClient //nolint:gochecknoglobals // extension point
Functions ¶
func AppEnvironment ¶
AppEnvironment returns the environment visible to this agent together with environment variables explicitly declared for the app container and minus the environment variables provided by this config.
func StartServices ¶ added in v2.17.0
func TalkToManager ¶
Types ¶
type Config ¶
type Config interface { Ext() agentconfig.SidecarExt AgentConfig() *agentconfig.Sidecar HasMounts(ctx context.Context) bool PodName() string PodIP() string }
type ContainerState ¶ added in v2.21.0
func NewContainerState ¶ added in v2.21.0
func NewContainerState(mountPoint string, env map[string]string) ContainerState
NewContainerState creates a ContainerState that provides the environment variables and the mount point for a container.
type InterceptState ¶ added in v2.6.0
type InterceptState interface { State Target() InterceptTarget InterceptInfo(ctx context.Context, callerID, path string, containerPort uint16, headers http.Header) (*restapi.InterceptInfo, error) }
An InterceptState implements what's needed to intercept one target port.
type InterceptTarget ¶ added in v2.18.0
type InterceptTarget []*agentconfig.Intercept
InterceptTarget describes the mapping between service ports and one container port, or if no service is used, just the container port. All entries must be guaranteed to all have the same Protocol, ContainerPort, and AgentPort. The slice must be considered immutable once created using NewInterceptTarget.
func NewInterceptTarget ¶ added in v2.18.0
func NewInterceptTarget(ics []*agentconfig.Intercept) InterceptTarget
func (InterceptTarget) AgentPort ¶ added in v2.18.0
func (cp InterceptTarget) AgentPort() uint16
func (InterceptTarget) AppProtocol ¶ added in v2.18.0
func (cp InterceptTarget) AppProtocol(ctx context.Context) (proto string)
func (InterceptTarget) ContainerPort ¶ added in v2.18.0
func (cp InterceptTarget) ContainerPort() uint16
func (InterceptTarget) ContainerPortName ¶ added in v2.18.0
func (cp InterceptTarget) ContainerPortName() string
func (InterceptTarget) HasServicePort ¶ added in v2.18.0
func (cp InterceptTarget) HasServicePort(port uint16) bool
func (InterceptTarget) HasServicePortName ¶ added in v2.18.0
func (cp InterceptTarget) HasServicePortName(name string) bool
func (InterceptTarget) MatchForSpec ¶ added in v2.18.0
func (cp InterceptTarget) MatchForSpec(spec *manager.InterceptSpec) bool
func (InterceptTarget) Protocol ¶ added in v2.18.0
func (cp InterceptTarget) Protocol() v1.Protocol
func (InterceptTarget) String ¶ added in v2.18.0
func (cp InterceptTarget) String() string
type ProviderMux ¶ added in v2.17.0
type ProviderMux struct { AgentProvider tunnel.ClientStreamProvider ManagerProvider tunnel.StreamProvider }
func (*ProviderMux) CreateClientStream ¶ added in v2.17.0
func (*ProviderMux) ReportMetrics ¶ added in v2.17.0
func (pm *ProviderMux) ReportMetrics(ctx context.Context, metrics *manager.TunnelMetrics)
type State ¶
type State interface { Config agent.AgentServer tunnel.ClientStreamProvider AddInterceptState(is InterceptState) AgentState() restapi.AgentState InterceptStates() []InterceptState HandleIntercepts(ctx context.Context, cepts []*manager.InterceptInfo) []*manager.ReviewInterceptRequest ManagerClient() manager.ManagerClient ManagerVersion() semver.Version SessionInfo() *manager.SessionInfo SetFileSharingPorts(ftp uint16, sftp uint16) SetManager(ctx context.Context, sessionInfo *manager.SessionInfo, manager manager.ManagerClient, version semver.Version) FtpPort() uint16 SftpPort() uint16 NewInterceptState(forwarder forwarder.Interceptor, target InterceptTarget, container string) InterceptState AddContainerState(containerName string, containerState ContainerState) }
State reflects the current state of the agent.