handler

package
v1.1.30 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 82 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RollbackFuncList = make([]func(), 2)

Functions

func Cleanup

func Cleanup(s os.Signal)

func CleanupUselessInfo

func CleanupUselessInfo(pod *v1.Pod)

func Complete

func Complete(route *core.Route) error

func Final

func Final() error

func InjectVPNAndEnvoySidecar

func InjectVPNAndEnvoySidecar(ctx1 context.Context, factory cmdutil.Factory, clientset v12.ConfigMapInterface, namespace, workloads string, c util.PodRouteConfig, headers map[string]string) (err error)

InjectVPNAndEnvoySidecar patch a sidecar, using iptables to do port-forward let this pod decide should go to 233.254.254.100 or request to 127.0.0.1

func InjectVPNSidecar

func InjectVPNSidecar(ctx1 context.Context, factory cmdutil.Factory, namespace, workloads string, config util.PodRouteConfig) error

func RemoveUselessInfo

func RemoveUselessInfo(u *unstructured.Unstructured)

func Rollback

func Rollback(f cmdutil.Factory, ns, workload string)

func SshJump

func SshJump(conf *util.SshConfig, flags *pflag.FlagSet) (err error)

func Start

func Start(ctx context.Context, r core.Route) error

func UnPatchContainer

func UnPatchContainer(factory cmdutil.Factory, mapInterface v12.ConfigMapInterface, namespace, workloads string, headers map[string]string) error

Types

type ConnectOptions

type ConnectOptions struct {
	Namespace   string
	Headers     map[string]string
	Workloads   []string
	ExtraCIDR   []string
	ExtraDomain []string
	// contains filtered or unexported fields
}

func (*ConnectOptions) DoConnect

func (c *ConnectOptions) DoConnect() (err error)

func (ConnectOptions) GetClientset

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

func (*ConnectOptions) GetKubeconfigPath

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

func (*ConnectOptions) GetRunningPodList

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

func (*ConnectOptions) InitClient

func (c *ConnectOptions) InitClient(f cmdutil.Factory) (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) Reset

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

Reset 1, get all proxy-resources from configmap 2, cleanup all containers

func (*ConnectOptions) UpdateImage

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

update to newer image

type DHCPManager

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

func NewDHCPManager

func NewDHCPManager(client corev1.ConfigMapInterface, namespace string) *DHCPManager

func (*DHCPManager) Get

func (d *DHCPManager) Get(ctx2 context.Context, key string) (string, error)

func (*DHCPManager) ReleaseIP

func (d *DHCPManager) ReleaseIP(ctx context.Context, ips ...net.IP) error

func (*DHCPManager) RentIPBaseNICAddress

func (d *DHCPManager) RentIPBaseNICAddress(ctx context.Context) (*net.IPNet, *net.IPNet, error)

func (*DHCPManager) RentIPRandom

func (d *DHCPManager) RentIPRandom(ctx context.Context) (*net.IPNet, *net.IPNet, error)

func (*DHCPManager) Set

func (d *DHCPManager) Set(key, value string) error

type DuplicateOptions

type DuplicateOptions struct {
	Namespace   string
	Headers     map[string]string
	Workloads   []string
	ExtraCIDR   []string
	ExtraDomain []string

	TargetKubeconfig       string
	TargetNamespace        string
	TargetContainer        string
	TargetImage            string
	TargetRegistry         string
	IsChangeTargetRegistry bool
	// contains filtered or unexported fields
}

func (*DuplicateOptions) DoDuplicate

func (d *DuplicateOptions) DoDuplicate(ctx context.Context) error

DoDuplicate

* 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 (*DuplicateOptions) InitClient

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

type P

type P struct {
	Op    string      `json:"op,omitempty"`
	Path  string      `json:"path,omitempty"`
	Value interface{} `json:"value,omitempty"`
}

Jump to

Keyboard shortcuts

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