handler

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const VPN = "vpn"

Variables

This section is empty.

Functions

func AddContainer

func AddContainer(spec *v1.PodSpec, c *PodRouteConfig)

func RemoveContainer

func RemoveContainer(spec *v1.PodSpec)

Types

type Handler

type Handler interface {
	InjectVPNContainer() error
	GetPod() ([]v1.Pod, error)
	Rollback(reset bool) error
}

type P

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

type PodHandler

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

func NewPodHandler

func NewPodHandler(factory cmdutil.Factory, podInterface coreV1.PodInterface, info *resource.Info, config *PodRouteConfig) *PodHandler

func (*PodHandler) GetPod

func (h *PodHandler) GetPod() ([]v1.Pod, error)

func (*PodHandler) InjectVPNContainer

func (h *PodHandler) InjectVPNContainer() error

func (*PodHandler) Rollback

func (h *PodHandler) Rollback(reset bool) error

type PodRouteConfig

type PodRouteConfig struct {
	LocalTunIP           string
	InboundPodTunIP      string
	TrafficManagerRealIP string
	Route                string
}

type ServiceHandler

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

func NewServiceHandler

func NewServiceHandler(factory cmdutil.Factory, serviceInterface coreV1.ServiceInterface, info *resource.Info, config *PodRouteConfig) *ServiceHandler

func (*ServiceHandler) GetPod

func (h *ServiceHandler) GetPod() ([]corev1.Pod, error)

func (*ServiceHandler) InjectVPNContainer

func (h *ServiceHandler) InjectVPNContainer() error

InjectVPNContainer try to find controllers using pod, using UnstructuredHandler to handler it, if can not find supported svcType, then delete it after backup

func (*ServiceHandler) Rollback

func (h *ServiceHandler) Rollback(reset bool) error

type UnstructuredHandler

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

func NewUnstructuredHandler

func NewUnstructuredHandler(
	factory cmdutil.Factory,
	info *runtimeresource.Info,
	config *PodRouteConfig,
) *UnstructuredHandler

func (*UnstructuredHandler) GetPod

func (h *UnstructuredHandler) GetPod() ([]corev1.Pod, error)

func (*UnstructuredHandler) InjectVPNContainer

func (h *UnstructuredHandler) InjectVPNContainer() error

InjectVPNContainer todo if can't find any pod with same label, needs to create a pod or not ?

func (*UnstructuredHandler) Rollback

func (h *UnstructuredHandler) Rollback(reset bool) error

Jump to

Keyboard shortcuts

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