Help us shape the future of Go! Take the 2026 Go Developer Survey

middlewares

package
v1.7.21 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkNotReadyErrorMsg = "network is not ready"
)

Variables

This section is empty.

Functions

func ValidateSwiftv2Pod

func ValidateSwiftv2Pod(pod v1.Pod) bool

validates if pod is multitenant by checking the pod labels, used in SWIFT V2 AKS scenario.

Types

type K8sSWIFTv2Middleware

type K8sSWIFTv2Middleware struct {
	Cli client.Client
}

func (*K8sSWIFTv2Middleware) AddRoutes

func (k *K8sSWIFTv2Middleware) AddRoutes(cidrs []string, gatewayIP string) []cns.Route

func (*K8sSWIFTv2Middleware) GetInfravnetAndServiceCidrs

func (k *K8sSWIFTv2Middleware) GetInfravnetAndServiceCidrs() ([]string, []string, error)

Both Linux and Windows CNS gets infravnet and service CIDRs from configuration env GetInfravnetAndServiceCidrs() returns v4CIDRs(infravnet and service cidrs) as first []string and v6CIDRs(infravnet and service) as second []string

func (*K8sSWIFTv2Middleware) GetPodCidrs

func (k *K8sSWIFTv2Middleware) GetPodCidrs() ([]string, []string, error)

Linux CNS gets pod CIDRs from configuration env Containerd reassigns the IP to the adapter and kernel configures the pod cidr route by default on Windows VM Hence the windows swiftv2 scenario does not require pod cidr GetPodCidrs() will return v4PodCidrs as first []string and v6PodCidrs as second []string

func (*K8sSWIFTv2Middleware) GetPodInfo

func (k *K8sSWIFTv2Middleware) GetPodInfo(ctx context.Context, req *cns.IPConfigsRequest) (podInfo cns.PodInfo, k8sPod v1.Pod, respCode types.ResponseCode, message string)

gets Pod Data

func (*K8sSWIFTv2Middleware) GetPodInfoForIPConfigsRequest

func (k *K8sSWIFTv2Middleware) GetPodInfoForIPConfigsRequest(ctx context.Context, req *cns.IPConfigsRequest) (podInfo cns.PodInfo, respCode types.ResponseCode, message string)

func (*K8sSWIFTv2Middleware) IPConfigsRequestHandlerWrapper

func (k *K8sSWIFTv2Middleware) IPConfigsRequestHandlerWrapper(defaultHandler, failureHandler cns.IPConfigsHandlerFunc) cns.IPConfigsHandlerFunc

IPConfigsRequestHandlerWrapper is the middleware function for handling SWIFT v2 IP configs requests for AKS-SWIFT. This function wrapped the default SWIFT request and release IP configs handlers.

func (*K8sSWIFTv2Middleware) Type

func (*K8sSWIFTv2Middleware) UpdateIPConfigRequest

func (k *K8sSWIFTv2Middleware) UpdateIPConfigRequest(mtpnc v1alpha1.MultitenantPodNetworkConfig, req *cns.IPConfigsRequest) (
	respCode types.ResponseCode,
	message string,
)

Updates Ip Config Request

type StandaloneSWIFTv2Middleware

type StandaloneSWIFTv2Middleware struct{}

func (*StandaloneSWIFTv2Middleware) IPConfigsRequestHandlerWrapper

func (m *StandaloneSWIFTv2Middleware) IPConfigsRequestHandlerWrapper(ipRequestHandler, _ cns.IPConfigsHandlerFunc) cns.IPConfigsHandlerFunc

IPConfigsRequestHandlerWrapper is the middleware function for handling SWIFT v2 IP config requests for SF standalone scenario. This function wraps the default SWIFT request and release IP configs handlers.

func (*StandaloneSWIFTv2Middleware) Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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