client

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIVersion is the API version of the daemon and connector API.
	APIVersion = 3
)
View Source
const ConfigFile = "config.yml"

Variables

View Source
var DisplayName = "Telepresence" //nolint:gochecknoglobals // extension point
View Source
var GetDefaultConfigFunc = func() Config {
	dflt := GetDefaultBaseConfig()
	return &dflt
}
View Source
var ValidateConfigFunc = func(context.Context, Config) error {
	return nil
}

Functions

func AppendKubeFlags added in v2.17.0

func AppendKubeFlags(kubeFlags map[string]string, args []string) ([]string, error)

AppendKubeFlags appends the flags in the given map to the given slice in the form of flag arguments suitable for command execution. Flags known to be multivalued are assumed to be in the form of comma-separated list and will be added using repeated options.

func CheckTimeout added in v2.1.2

func CheckTimeout(ctx context.Context, err error) error

func ConfigFlags added in v2.12.0

func ConfigFlags(flagMap map[string]string) (*genericclioptions.ConfigFlags, error)

func ConfigLoader added in v2.16.0

func ConfigLoader(flagMap map[string]string) (clientcmd.ClientConfig, error)

ConfigLoader returns the name of the current Kubernetes context, and the context itself.

func CurrentContext added in v2.12.0

func CurrentContext(flagMap map[string]string) (string, string, *api.Context, error)

CurrentContext returns the name of the current Kubernetes context, the active namespace, and the context itself.

func DisplayVersion

func DisplayVersion() string

DisplayVersion returns a printable version for `telepresence`.

func Executable added in v2.5.0

func Executable() (string, error)

func GetConfigFile added in v2.3.5

func GetConfigFile(c context.Context) string

GetConfigFile gets the path to the configFile as stored in filelocation.AppUserConfigDir.

func GetExe

func GetExe(ctx context.Context) string

GetExe returns the name of the running executable.

func GetInstallMechanism added in v2.4.8

func GetInstallMechanism() (string, error)

GetInstallMechanism returns how the executable was installed on the machine.

func GetMechanismFromPath added in v2.4.8

func GetMechanismFromPath(execPath string) (string, error)

GetMechanismFromPath is a helper function that contains most of the logic required for GetInstallMechanism, but enables us to test it since we can control the path passed in.

func IsDaemon added in v2.9.0

func IsDaemon() bool

func LoadEnvWithInto added in v2.14.1

func LoadEnvWithInto(lookupFunc func(key string) (string, bool), env any) (any, error)

func MergeAndReplace added in v2.9.0

func MergeAndReplace(c context.Context, defaults Config, priority Config, root bool) error

func ProcessName added in v2.9.0

func ProcessName() string

func ReloadDaemonConfig added in v2.9.0

func ReloadDaemonConfig(c context.Context, root bool) error

ReloadDaemonConfig calls SetLevel with the log level defined for the rootDaemon or userDaemon depending on the root flag. Assumes that the config has already been reloaded.

func ReplaceConfig added in v2.5.0

func ReplaceConfig(ctx context.Context, config Config)

ReplaceConfig replaces the config last stored using WithConfig with the given Config.

func RestoreDefaults added in v2.9.0

func RestoreDefaults(c context.Context, root bool) error

func Retry

func Retry(c context.Context, text string, f func(context.Context) error, durations ...time.Duration) error

Retry will run the given function repeatedly with an increasing delay until it returns without error.

The function takes 0 to 2 durations with the following meaning

Delay - initial delay, i.e. the delay between the first and the second call.
MaxDelay - maximum delay between calling the functions (delay will never grow beyond this value)

func RunError

func RunError(err error) error

RunError checks if the given err is a *exit.ExitError, and if so, extracts Stderr and the ExitCode from it.

func Semver

func Semver() semver.Version

func StringKey added in v2.14.1

func StringKey(n *yaml.Node) (string, error)

func Version

func Version() string

Version returns the version of this executable.

func Watch added in v2.5.0

func Watch(c context.Context, onReload func(context.Context) error) error

Watch uses a file system watcher that receives events when the configuration changes and calls the given function when that happens.

func WithConfig added in v2.4.2

func WithConfig(ctx context.Context, config Config) context.Context

WithConfig returns a context with the given Config.

func WithEnsuredState

func WithEnsuredState(ctx context.Context, prolog Prolog, action, epilog Action) error

WithEnsuredState calls prolog, and if that was successful, calls act. If epilog is not nil, it is guaranteed to be called when prolog returns true.

func WithEnv added in v2.4.2

func WithEnv(ctx context.Context, env *Env) context.Context

WithEnv returns a context with the given Env.

func WithLoc added in v2.14.1

func WithLoc(s string, n *yaml.Node) string

func WrapRecvErr added in v2.3.3

func WrapRecvErr(err error, msg string) error

WrapRecvErr wraps an error from a Recv call. If the error is nil, nil is returned. If the error indicates that the remote end has , a RecvEOFError wrapping the error will be returned. Otherwise, the original error will be wrapped as fmt.Errorf("%s: %w", msg, err).

Types

type Action added in v2.9.0

type Action func(context.Context) error

type BaseConfig added in v2.14.1

type BaseConfig struct {
	OSSpecificConfig `yaml:",inline"`
	TimeoutsV        Timeouts        `json:"timeouts,omitempty" yaml:"timeouts,omitempty"`
	LogLevelsV       LogLevels       `json:"logLevels,omitempty" yaml:"logLevels,omitempty"`
	ImagesV          Images          `json:"images,omitempty" yaml:"images,omitempty"`
	GrpcV            Grpc            `json:"grpc,omitempty" yaml:"grpc,omitempty"`
	TelepresenceAPIV TelepresenceAPI `json:"telepresenceAPI,omitempty" yaml:"telepresenceAPI,omitempty"`
	InterceptV       Intercept       `json:"intercept,omitempty" yaml:"intercept,omitempty"`
	ClusterV         Cluster         `json:"cluster,omitempty" yaml:"cluster,omitempty"`
}

BaseConfig contains all configuration values for the telepresence CLI.

func GetDefaultBaseConfig added in v2.14.1

func GetDefaultBaseConfig() BaseConfig

GetDefaultConfig returns the default configuration settings.

func (*BaseConfig) Base added in v2.14.1

func (c *BaseConfig) Base() *BaseConfig

func (*BaseConfig) Cluster added in v2.14.1

func (c *BaseConfig) Cluster() *Cluster

func (*BaseConfig) Grpc added in v2.14.1

func (c *BaseConfig) Grpc() *Grpc

func (*BaseConfig) Images added in v2.14.1

func (c *BaseConfig) Images() *Images

func (*BaseConfig) Intercept added in v2.14.1

func (c *BaseConfig) Intercept() *Intercept

func (*BaseConfig) LogLevels added in v2.14.1

func (c *BaseConfig) LogLevels() *LogLevels

func (*BaseConfig) Merge added in v2.14.1

func (c *BaseConfig) Merge(lc Config)

Merge merges this instance with the non-zero values of the given argument. The argument values take priority.

func (*BaseConfig) OSSpecific added in v2.14.1

func (c *BaseConfig) OSSpecific() *OSSpecificConfig

func (*BaseConfig) String added in v2.14.1

func (c *BaseConfig) String() string

func (*BaseConfig) TelepresenceAPI added in v2.14.1

func (c *BaseConfig) TelepresenceAPI() *TelepresenceAPI

func (*BaseConfig) Timeouts added in v2.14.1

func (c *BaseConfig) Timeouts() *Timeouts

type Cluster added in v2.11.0

type Cluster struct {
	DefaultManagerNamespace string   `json:"defaultManagerNamespace,omitempty" yaml:"defaultManagerNamespace,omitempty"`
	MappedNamespaces        []string `json:"mappedNamespaces,omitempty" yaml:"mappedNamespaces,omitempty"`
	ConnectFromRootDaemon   bool     `json:"connectFromRootDaemon,omitempty" yaml:"connectFromRootDaemon,omitempty"`
	AgentPortForward        bool     `json:"agentPortForward,omitempty" yaml:"agentPortForward,omitempty"`
	VirtualIPSubnet         string   `json:"virtualIPSubnet,omitempty" yaml:"virtualIPSubnet,omitempty"`
}

func (Cluster) IsZero added in v2.11.0

func (cc Cluster) IsZero() bool

IsZero controls whether this element will be included in marshalled output.

func (Cluster) MarshalYAML added in v2.11.0

func (cc Cluster) MarshalYAML() (any, error)

MarshalYAML is not using pointer receiver here, because Cluster is not pointer in the Config struct.

type Config added in v2.1.2

type Config interface {
	fmt.Stringer
	OSSpecific() *OSSpecificConfig
	Base() *BaseConfig
	Timeouts() *Timeouts
	LogLevels() *LogLevels
	Images() *Images
	Grpc() *Grpc
	TelepresenceAPI() *TelepresenceAPI
	Intercept() *Intercept
	Cluster() *Cluster
	Merge(Config)
}

func GetConfig added in v2.1.2

func GetConfig(ctx context.Context) Config

func GetDefaultConfig added in v2.4.2

func GetDefaultConfig() Config

GetDefaultConfig returns the default configuration settings.

func LoadConfig added in v2.4.2

func LoadConfig(c context.Context) (cfg Config, err error)

LoadConfig loads and returns the Telepresence configuration as stored in filelocation.AppUserConfigDir or filelocation.AppSystemConfigDirs.

func ParseConfigYAML added in v2.13.0

func ParseConfigYAML(data []byte) (Config, error)

type DNS added in v2.9.0

type DNS struct {
	Error           string        `json:"error,omitempty" yaml:"error,omitempty"`
	LocalIP         net.IP        `json:"localIP,omitempty" yaml:"localIP,omitempty"`
	RemoteIP        net.IP        `json:"remoteIP,omitempty" yaml:"remoteIP,omitempty"`
	IncludeSuffixes []string      `json:"includeSuffixes,omitempty" yaml:"includeSuffixes,omitempty"`
	ExcludeSuffixes []string      `json:"excludeSuffixes,omitempty" yaml:"excludeSuffixes,omitempty"`
	Excludes        []string      `json:"excludes,omitempty" yaml:"excludes,omitempty"`
	Mappings        DNSMappings   `json:"mappings,omitempty" yaml:"mappings,omitempty"`
	LookupTimeout   time.Duration `json:"lookupTimeout,omitempty" yaml:"lookupTimeout,omitempty"`
}

type DNSMapping added in v2.14.0

type DNSMapping struct {
	Name     string `json:"name,omitempty" yaml:"name,omitempty"`
	AliasFor string `json:"aliasFor,omitempty" yaml:"aliasFor,omitempty"`
}

DNSMapping contains a hostname and its associated alias. When requesting the name, the intended behavior is to resolve the alias instead.

type DNSMappings added in v2.14.0

type DNSMappings []*DNSMapping

func (*DNSMappings) FromRPC added in v2.14.0

func (d *DNSMappings) FromRPC(rpcMappings []*rpc.DNSMapping)

func (DNSMappings) ToRPC added in v2.14.0

func (d DNSMappings) ToRPC() []*rpc.DNSMapping

type DNSSnake added in v2.9.0

type DNSSnake struct {
	Error           string        `json:"error,omitempty" yaml:"error,omitempty"`
	LocalIP         net.IP        `json:"local_ip,omitempty" yaml:"local_ip,omitempty"`
	RemoteIP        net.IP        `json:"remote_ip,omitempty" yaml:"remote_ip,omitempty"`
	IncludeSuffixes []string      `json:"include_suffixes,omitempty" yaml:"include_suffixes,omitempty"`
	ExcludeSuffixes []string      `json:"exclude_suffixes,omitempty" yaml:"exclude_suffixes,omitempty"`
	Excludes        []string      `json:"excludes,omitempty" yaml:"excludes,omitempty"`
	Mappings        DNSMappings   `json:"mappings,omitempty" yaml:"mappings,omitempty"`
	LookupTimeout   time.Duration `json:"lookup_timeout,omitempty" yaml:"lookup_timeout,omitempty"`
}

DNSSnake is the same as DNS but with snake_case json/yaml names.

type DnsConfig added in v2.9.0

type DnsConfig struct {
	// LocalIP is the address of the local DNS server. This entry is only
	// used on Linux system that are not configured to use systemd-resolved and
	// can be overridden by using the option --dns on the command line and defaults
	// to the first line of /etc/resolv.conf
	LocalIP iputil.IPKey `json:"local-ip,omitempty"`

	// RemoteIP is the address of the cluster's DNS service. It will default
	// to the IP of the kube-dns.kube-system or the dns-default.openshift-dns service.
	RemoteIP iputil.IPKey `json:"remote-ip,omitempty"`

	// ExcludeSuffixes are suffixes for which the DNS resolver will always return
	// NXDOMAIN (or fallback in case of the overriding resolver).
	ExcludeSuffixes []string `json:"exclude-suffixes,omitempty"`

	// IncludeSuffixes are suffixes for which the DNS resolver will always attempt to do
	// a lookup. Includes have higher priority than excludes.
	IncludeSuffixes []string `json:"include-suffixes,omitempty"`

	// Excludes are a list of hostname that the DNS resolver will not resolve even if they exist.
	Excludes []string `json:"excludes,omitempty"`

	// Mappings contains a list of DNS Mappings. Each item references a hostname, and an associated alias. If a
	// request is made for the name, the alias will be resolved instead.
	Mappings DNSMappings `json:"mappings,omitempty"`

	// The maximum time to wait for a cluster side host lookup.
	LookupTimeout v1.Duration `json:"lookup-timeout,omitempty"`
}

The DnsConfig is part of the KubeconfigExtension struct.

type Env

type Env struct {
	OSSpecificEnv
	ManagerNamespace string `env:"TELEPRESENCE_MANAGER_NAMESPACE,   parser=nonempty-string"`

	// This environment variable becomes the default for the images.registry and images.webhookRegistry
	Registry string `env:"TELEPRESENCE_REGISTRY,                        parser=possibly-empty-string,default="`

	// This environment variable becomes the default for the images.agentImage and images.webhookAgentImage
	AgentImage string `env:"TELEPRESENCE_AGENT_IMAGE,                   parser=possibly-empty-string,default="`

	// This environment variable becomes the default for the images.clientImage
	ClientImage string `env:"TELEPRESENCE_CLIENT_IMAGE,                   parser=possibly-empty-string,default="`

	// The address that the user daemon is listening to (unless it is started by the client and uses a named pipe or unix socket).
	UserDaemonAddress string `env:"TELEPRESENCE_USER_DAEMON_ADDRESS, parser=possibly-empty-string,default="`
	ScoutDisable      bool   `env:"SCOUT_DISABLE, parser=strconv.ParseBool, default=0"`
}

func GetEnv added in v2.4.2

func GetEnv(ctx context.Context) *Env

func LoadEnv

func LoadEnv() (*Env, error)

func LoadEnvWith added in v2.4.7

func LoadEnvWith(lookupFunc func(key string) (string, bool)) (*Env, error)

type Grpc added in v2.3.5

type Grpc struct {
	// MaxReceiveSize is the maximum message size in bytes the client can receive in a gRPC call or stream message.
	// Overrides the gRPC default of 4MB.
	MaxReceiveSizeV resource.Quantity `json:"maxReceiveSize,omitempty" yaml:"maxReceiveSize,omitempty"`
}

func (Grpc) IsZero added in v2.14.1

func (g Grpc) IsZero() bool

IsZero controls whether this element will be included in marshalled output.

func (Grpc) MarshalYAML added in v2.4.4

func (g Grpc) MarshalYAML() (any, error)

MarshalYAML is not using pointer receiver here, because Cloud is not pointer in the Config struct.

func (*Grpc) MaxReceiveSize added in v2.3.5

func (g *Grpc) MaxReceiveSize() int64

func (*Grpc) UnmarshalYAML added in v2.3.5

func (g *Grpc) UnmarshalYAML(node *yaml.Node) (err error)

UnmarshalYAML parses the images YAML.

type Images added in v2.3.5

type Images struct {
	PrivateRegistry        string `json:"registry,omitempty" yaml:"registry,omitempty"`
	PrivateAgentImage      string `json:"agentImage,omitempty" yaml:"agentImage,omitempty"`
	PrivateClientImage     string `json:"clientImage,omitempty" yaml:"clientImage,omitempty"`
	PrivateWebhookRegistry string `json:"webhookRegistry,omitempty" yaml:"webhookRegistry,omitempty"`
}

func (*Images) AgentImage added in v2.3.5

func (img *Images) AgentImage(c context.Context) string

func (*Images) ClientImage added in v2.17.0

func (img *Images) ClientImage(c context.Context) string

func (Images) IsZero added in v2.14.1

func (img Images) IsZero() bool

IsZero controls whether this element will be included in marshalled output.

func (Images) MarshalYAML added in v2.14.1

func (img Images) MarshalYAML() (any, error)

MarshalYAML is not using pointer receiver here, because Cloud is not pointer in the Config struct.

func (*Images) Registry added in v2.3.5

func (img *Images) Registry(c context.Context) string

func (*Images) UnmarshalYAML added in v2.3.5

func (img *Images) UnmarshalYAML(node *yaml.Node) (err error)

UnmarshalYAML parses the images YAML.

func (*Images) WebhookRegistry added in v2.3.5

func (img *Images) WebhookRegistry(c context.Context) string

type Intercept added in v2.4.10

type Intercept struct {
	AppProtocolStrategy k8sapi.AppProtocolStrategy `json:"appProtocolStrategy,omitempty" yaml:"appProtocolStrategy,omitempty"`
	DefaultPort         int                        `json:"defaultPort,omitempty" yaml:"defaultPort,omitempty"`
	UseFtp              bool                       `json:"useFtp,omitempty" yaml:"useFtp,omitempty"`
}

func (Intercept) IsZero added in v2.5.0

func (ic Intercept) IsZero() bool

IsZero controls whether this element will be included in marshalled output.

func (Intercept) MarshalYAML added in v2.4.10

func (ic Intercept) MarshalYAML() (any, error)

MarshalYAML is not using pointer receiver here, because Intercept is not pointer in the Config struct.

type Kubeconfig added in v2.9.0

type Kubeconfig struct {
	KubeconfigExtension
	Namespace        string // default cluster namespace.
	Context          string
	Server           string
	OriginalFlagMap  map[string]string
	EffectiveFlagMap map[string]string
	ConfigFlags      *genericclioptions.ConfigFlags
	RestConfig       *rest.Config
}

func DaemonKubeconfig added in v2.12.0

func DaemonKubeconfig(c context.Context, cr *connector.ConnectRequest) (*Kubeconfig, error)

func NewInClusterConfig added in v2.9.0

func NewInClusterConfig(c context.Context, flagMap map[string]string) (*Kubeconfig, error)

NewInClusterConfig represents an inClusterConfig.

func NewKubeconfig added in v2.9.0

func NewKubeconfig(c context.Context, flagMap map[string]string, managerNamespaceOverride string) (*Kubeconfig, error)

func (*Kubeconfig) AddRemoteKubeConfigExtension added in v2.9.0

func (kf *Kubeconfig) AddRemoteKubeConfigExtension(ctx context.Context, cfgYaml []byte) error

func (*Kubeconfig) ContextServiceAndFlagsEqual added in v2.9.0

func (kf *Kubeconfig) ContextServiceAndFlagsEqual(okf *Kubeconfig) bool

ContextServiceAndFlagsEqual determines if this instance is equal to the given instance with respect to context, server, and flag arguments.

func (*Kubeconfig) GetContext added in v2.12.0

func (kf *Kubeconfig) GetContext() string

func (*Kubeconfig) GetManagerNamespace added in v2.9.0

func (kf *Kubeconfig) GetManagerNamespace() string

func (*Kubeconfig) GetRestConfig added in v2.9.0

func (kf *Kubeconfig) GetRestConfig() *rest.Config

type KubeconfigExtension added in v2.9.0

type KubeconfigExtension struct {
	DNS                     *DnsConfig       `json:"dns,omitempty"`
	AlsoProxy               []*iputil.Subnet `json:"also-proxy,omitempty"`
	NeverProxy              []*iputil.Subnet `json:"never-proxy,omitempty"`
	AllowConflictingSubnets []*iputil.Subnet `json:"allow-conflicting-subnets,omitempty"`
	Manager                 *ManagerConfig   `json:"manager,omitempty"`
}

KubeconfigExtension is an extension read from the selected kubeconfig Cluster.

type LogLevels added in v2.3.0

type LogLevels struct {
	UserDaemon logrus.Level `json:"userDaemon,omitempty" yaml:"userDaemon,omitempty"`
	RootDaemon logrus.Level `json:"rootDaemon,omitempty" yaml:"rootDaemon,omitempty"`
}

func (LogLevels) IsZero added in v2.5.0

func (ll LogLevels) IsZero() bool

IsZero controls whether this element will be included in marshalled output.

func (*LogLevels) UnmarshalYAML added in v2.3.0

func (ll *LogLevels) UnmarshalYAML(node *yaml.Node) (err error)

UnmarshalYAML parses the logrus log-levels.

type ManagerConfig added in v2.9.0

type ManagerConfig struct {
	// Namespace is the name of the namespace where the traffic manager is to be found
	Namespace string `json:"namespace,omitempty"`
}

The ManagerConfig is part of the KubeconfigExtension struct. It configures discovery of the traffic manager.

type OSSpecificConfig added in v2.13.2

type OSSpecificConfig struct{}

func GetDefaultOSSpecificConfig added in v2.13.2

func GetDefaultOSSpecificConfig() OSSpecificConfig

func (*OSSpecificConfig) Merge added in v2.13.2

func (c *OSSpecificConfig) Merge(o *OSSpecificConfig)

type OSSpecificEnv added in v2.12.0

type OSSpecificEnv struct {
	Shell string `env:"SHELL, parser=nonempty-string,default=/bin/bash"`
}

type Prolog added in v2.9.0

type Prolog func(context.Context) (acquired bool, err error)

type RecvEOFError added in v2.8.0

type RecvEOFError struct {
	// contains filtered or unexported fields
}

RecvEOFError should be returned when a component has returned EOF from a stream. Do not use this if, for example, the initial dial to a stream fails.

func (*RecvEOFError) Error added in v2.8.0

func (e *RecvEOFError) Error() string

func (*RecvEOFError) Unwrap added in v2.8.0

func (e *RecvEOFError) Unwrap() error

type Routing added in v2.9.0

type Routing struct {
	Subnets          []*iputil.Subnet `json:"subnets,omitempty" yaml:"subnets,omitempty"`
	AlsoProxy        []*iputil.Subnet `json:"alsoProxy,omitempty" yaml:"alsoProxy,omitempty"`
	NeverProxy       []*iputil.Subnet `json:"neverProxy,omitempty" yaml:"neverProxy,omitempty"`
	AllowConflicting []*iputil.Subnet `json:"allowConflicting,omitempty" yaml:"allowConflicting,omitempty"`
}

type RoutingSnake added in v2.9.0

type RoutingSnake struct {
	Subnets          []*iputil.Subnet `json:"subnets,omitempty" yaml:"subnets,omitempty"`
	AlsoProxy        []*iputil.Subnet `json:"also_proxy_subnets,omitempty" yaml:"also_proxy_subnets,omitempty"`
	NeverProxy       []*iputil.Subnet `json:"never_proxy_subnets,omitempty" yaml:"never_proxy_subnets,omitempty"`
	AllowConflicting []*iputil.Subnet `json:"allow_conflicting_subnets,omitempty" yaml:"allow_conflicting_subnets,omitempty"`
}

RoutingSnake is the same as Routing but with snake_case json/yaml names.

type SessionConfig added in v2.9.0

type SessionConfig struct {
	Config           `json:"clientConfig" yaml:"clientConfig"`
	ClientFile       string  `json:"clientFile,omitempty" yaml:"clientFile,omitempty"`
	DNS              DNS     `json:"dns,omitempty" yaml:"dns,omitempty"`
	Routing          Routing `json:"routing,omitempty" yaml:"routing,omitempty"`
	ManagerNamespace string  `json:"managerNamespace,omitempty" yaml:"managerNamespace,omitempty"`
}

func (*SessionConfig) UnmarshalJSON added in v2.14.1

func (sc *SessionConfig) UnmarshalJSON(data []byte) error

type TelepresenceAPI added in v2.4.8

type TelepresenceAPI struct {
	Port int `json:"port,omitempty" yaml:"port,omitempty"`
}

type TimeoutID added in v2.3.0

type TimeoutID int
const (
	TimeoutAgentInstall TimeoutID = iota
	TimeoutApply
	TimeoutClusterConnect
	TimeoutConnectivityCheck
	TimeoutEndpointDial
	TimeoutHelm
	TimeoutIntercept
	TimeoutProxyDial
	TimeoutRoundtripLatency
	TimeoutTrafficManagerAPI
	TimeoutTrafficManagerConnect
	TimeoutFtpReadWrite
	TimeoutFtpShutdown
)

type Timeouts added in v2.1.2

type Timeouts struct {

	// PrivateAgentInstall is how long to wait for an agent to be installed (i.e. apply of service and deploy manifests)
	PrivateAgentInstall time.Duration `json:"agentInstall" yaml:"agentInstall"`
	// PrivateApply is how long to wait for a k8s manifest to be applied
	PrivateApply time.Duration `json:"apply" yaml:"apply"`
	// PrivateClusterConnect is the maximum time to wait for a connection to the cluster to be established
	PrivateClusterConnect time.Duration `json:"clusterConnect" yaml:"clusterConnect"`
	// PrivateConnectivityCheck timeout used when checking if cluster is already proxied on the workstation
	PrivateConnectivityCheck time.Duration `json:"connectivityCheck" yaml:"connectivityCheck"`
	// PrivateEndpointDial is how long to wait for a Dial to a service for which the IP is known.
	PrivateEndpointDial time.Duration `json:"endpointDial" yaml:"endpointDial"`
	// PrivateHelm is how long to wait for any helm operation.
	PrivateHelm time.Duration `json:"helm" yaml:"helm"`
	// PrivateIntercept is the time to wait for an intercept after the agents has been installed
	PrivateIntercept time.Duration `json:"intercept" yaml:"intercept"`
	// PrivateRoundtripLatency is how much to add  to the EndpointDial timeout when establishing a remote connection.
	PrivateRoundtripLatency time.Duration `json:"roundtripLatency" yaml:"roundtripLatency"`
	// PrivateProxyDial is how long to wait for the proxy to establish an outbound connection
	PrivateProxyDial time.Duration `json:"proxyDial" yaml:"proxyDial"`
	// PrivateTrafficManagerConnect is how long to wait for the traffic-manager API to connect
	PrivateTrafficManagerAPI time.Duration `json:"trafficManagerAPI" yaml:"trafficManagerAPI"`
	// PrivateTrafficManagerConnect is how long to wait for the initial port-forwards to the traffic-manager
	PrivateTrafficManagerConnect time.Duration `json:"trafficManagerConnect" yaml:"trafficManagerConnect"`
	// PrivateFtpReadWrite read/write timeout used by the fuseftp client.
	PrivateFtpReadWrite time.Duration `json:"ftpReadWrite" yaml:"ftpReadWrite"`
	// PrivateFtpShutdown max time to wait for the fuseftp client to complete pending operations before forcing termination.
	PrivateFtpShutdown time.Duration `json:"ftpShutdown" yaml:"ftpShutdown"`
}

func (*Timeouts) Get added in v2.4.2

func (t *Timeouts) Get(timeoutID TimeoutID) time.Duration

func (Timeouts) IsZero added in v2.5.0

func (t Timeouts) IsZero() bool

IsZero controls whether this element will be included in marshalled output.

func (Timeouts) MarshalYAML added in v2.4.4

func (t Timeouts) MarshalYAML() (any, error)

MarshalYAML is not using pointer receiver here, because Timeouts is not pointer in the Config struct.

func (*Timeouts) TimeoutContext added in v2.3.0

func (t *Timeouts) TimeoutContext(ctx context.Context, timeoutID TimeoutID) (context.Context, context.CancelFunc)

func (*Timeouts) UnmarshalYAML added in v2.1.2

func (t *Timeouts) UnmarshalYAML(node *yaml.Node) (err error)

UnmarshalYAML caters for the unfortunate fact that time.Duration doesn't do YAML or JSON at all.

Directories

Path Synopsis
cli
ann
cmd
output
Package output provides structured output for *cobra.Command.
Package output provides structured output for *cobra.Command.
Package docker contains the functions necessary to start or discover a Telepresence daemon running in a docker container.
Package docker contains the functions necessary to start or discover a Telepresence daemon running in a docker container.
dns
vip
k8s

Jump to

Keyboard shortcuts

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