handler

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 86 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddExtraRoute added in v2.2.8

func AddExtraRoute(flags *pflag.FlagSet, route *ExtraRouteInfo)

func Complete added in v2.2.2

func Complete(ctx context.Context, route *core.Route) error

func Parse

func Parse(r core.Route) ([]core.Server, error)

func RemoveUselessInfo

func RemoveUselessInfo(u *unstructured.Unstructured)

func Run

func Run(ctx context.Context, servers []core.Server) error

Types

type CloneOptions

type CloneOptions struct {
	Namespace      string
	Headers        map[string]string
	Workloads      []string
	ExtraRouteInfo ExtraRouteInfo
	Engine         config.Engine

	TargetKubeconfig       string
	TargetNamespace        string
	TargetContainer        string
	TargetImage            string
	TargetRegistry         string
	IsChangeTargetRegistry bool
	TargetWorkloadNames    map[string]string

	OriginKubeconfigPath string
	LocalDir             string
	RemoteDir            string
	// contains filtered or unexported fields
}

func (*CloneOptions) AddRollbackFunc added in v2.2.9

func (d *CloneOptions) AddRollbackFunc(f func() error)

func (*CloneOptions) Cleanup

func (d *CloneOptions) Cleanup(workloads ...string) error

func (*CloneOptions) DoClone

func (d *CloneOptions) DoClone(ctx context.Context, kubeconfigJsonBytes []byte) error

DoClone

* 1) download mount path use empty-dir but skip empty-dir in init-containers * 2) get env from containers * 3) create serviceAccount as needed * 4) modify podTempSpec inject kubevpn container

func (*CloneOptions) GetFactory added in v2.2.8

func (d *CloneOptions) GetFactory() cmdutil.Factory

func (*CloneOptions) GetSyncthingGUIAddr added in v2.2.11

func (d *CloneOptions) GetSyncthingGUIAddr() string

func (*CloneOptions) InitClient

func (d *CloneOptions) InitClient(f cmdutil.Factory) (err error)

func (*CloneOptions) SetContext added in v2.2.11

func (d *CloneOptions) SetContext(ctx context.Context)

func (*CloneOptions) SyncDir added in v2.2.17

func (d *CloneOptions) SyncDir(ctx context.Context, labels string) error

type ConnectOptions

type ConnectOptions struct {
	Namespace            string
	Headers              map[string]string
	PortMap              []string
	Workloads            []string
	ExtraRouteInfo       ExtraRouteInfo
	Engine               config.Engine
	Foreground           bool
	OriginKubeconfigPath string
	Lock                 *sync.Mutex
	// contains filtered or unexported fields
}

func (*ConnectOptions) AddRolloutFunc

func (c *ConnectOptions) AddRolloutFunc(f func() error)

func (*ConnectOptions) Cleanup

func (c *ConnectOptions) Cleanup()

func (*ConnectOptions) CleanupLocalContainer

func (c *ConnectOptions) CleanupLocalContainer(ctx context.Context) error

func (*ConnectOptions) Context

func (c *ConnectOptions) Context() context.Context

func (*ConnectOptions) CreateRemoteInboundPod

func (c *ConnectOptions) CreateRemoteInboundPod(ctx context.Context) (err error)

func (*ConnectOptions) DoConnect

func (c *ConnectOptions) DoConnect(ctx context.Context, isLite bool) (err error)

func (*ConnectOptions) Equal

func (c *ConnectOptions) Equal(a *ConnectOptions) bool

func (*ConnectOptions) GetClientset

func (c *ConnectOptions) GetClientset() *kubernetes.Clientset

func (*ConnectOptions) GetClusterID added in v2.2.7

func (c *ConnectOptions) GetClusterID() string

func (*ConnectOptions) GetFactory

func (c *ConnectOptions) GetFactory() cmdutil.Factory

func (*ConnectOptions) GetIPFromContext added in v2.2.15

func (c *ConnectOptions) GetIPFromContext(ctx context.Context) error

func (*ConnectOptions) GetLocalTunIP added in v2.2.9

func (c *ConnectOptions) GetLocalTunIP() (v4 string, v6 string)

func (*ConnectOptions) GetRunningPodList

func (c *ConnectOptions) GetRunningPodList(ctx context.Context) ([]v1.Pod, error)

func (*ConnectOptions) GetTunDeviceName

func (c *ConnectOptions) GetTunDeviceName() (string, error)

func (*ConnectOptions) InitClient

func (c *ConnectOptions) InitClient(f cmdutil.Factory) (err error)

func (*ConnectOptions) InitDHCP

func (c *ConnectOptions) InitDHCP(ctx context.Context) error

func (*ConnectOptions) LeaveProxyResources

func (c *ConnectOptions) LeaveProxyResources(ctx context.Context) (err error)

func (*ConnectOptions) PreCheckResource

func (c *ConnectOptions) PreCheckResource() error

PreCheckResource transform user parameter to normal, example: pod: productpage-7667dfcddb-cbsn5 replicast: productpage-7667dfcddb deployment: productpage transform: pod/productpage-7667dfcddb-cbsn5 --> deployment/productpage service/productpage --> deployment/productpage replicaset/productpage-7667dfcddb --> deployment/productpage

pods without controller pod/productpage-without-controller --> pod/productpage-without-controller service/productpage-without-pod --> controller/controllerName

func (*ConnectOptions) RentIP added in v2.2.15

func (c *ConnectOptions) RentIP(ctx context.Context) (context.Context, error)

func (*ConnectOptions) Reset

func (c *ConnectOptions) Reset(ctx context.Context) error

Reset 1) quit daemon 2) get all proxy-resources from configmap 3) cleanup all containers 4) cleanup hosts

type Connects added in v2.2.3

type Connects []*ConnectOptions

func (Connects) Append added in v2.2.3

func (s Connects) Append(options *ConnectOptions) Connects

func (Connects) Len added in v2.2.3

func (s Connects) Len() int

func (Connects) Less added in v2.2.3

func (s Connects) Less(i, j int) bool

Less ... * assume: clusterA and clusterB in same VPC network, but only clusterA api-server have public ip, we need access clusterB via clusterA network. steps:

  • connect to clusterA with options --extra-cidr or --extra-domain (which container clusterB api-server address)
  • connect to clusterB

when we disconnect from all: first, we need to disconnect clusterB second, disconnect clusterA

func (Connects) Sort added in v2.2.3

func (s Connects) Sort() Connects

Sort ... base order: first connect last disconnect sort by dependency

func (Connects) Swap added in v2.2.3

func (s Connects) Swap(i, j int)

type ExtraRouteInfo added in v2.2.3

type ExtraRouteInfo struct {
	ExtraCIDR   []string
	ExtraDomain []string
	ExtraNodeIP bool
}

func ParseExtraRouteFromRPC added in v2.2.3

func ParseExtraRouteFromRPC(route *rpc.ExtraRoute) *ExtraRouteInfo

func (ExtraRouteInfo) ToRPC added in v2.2.3

func (e ExtraRouteInfo) ToRPC() *rpc.ExtraRoute

Jump to

Keyboard shortcuts

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