common

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 15 Imported by: 13

Documentation

Index

Constants

View Source
const (
	MetricResTypeSecurityPolicy    = "securitypolicy"
	MetricResTypeIPPool            = "ippool"
	MetricResTypeNSXServiceAccount = "nsxserviceaccount"
	MetricResTypeSubnetPort        = "subnetport"
	MetricResTypeStaticRoute       = "staticroute"
	MetricResTypeSubnet            = "subnet"
	MetricResTypeSubnetSet         = "subnetset"
	MetricResTypeVPC               = "vpc"
	MetricResTypeNamespace         = "namespace"
	MetricResTypePod               = "pod"
	MetricResTypeNode              = "node"

	LabelK8sMasterRole  = "node-role.kubernetes.io/master"
	LabelK8sControlRole = "node-role.kubernetes.io/control-plane"
)

Variables

View Source
var (
	ResultNormal  = ctrl.Result{}
	ResultRequeue = ctrl.Result{Requeue: true}
	// for k8s events that need to retry in short loop, eg: namespace creation
	ResultRequeueAfter10sec = ctrl.Result{Requeue: true, RequeueAfter: 10 * time.Second}
	// for unstable event, eg: failed to k8s resources when reconciling, may due to k8s unstable
	ResultRequeueAfter5mins = ctrl.Result{Requeue: true, RequeueAfter: 5 * time.Minute}

	ServiceMediator = mediator.ServiceMediator{}
)

Functions

func AllocateSubnetFromSubnetSet

func AllocateSubnetFromSubnetSet(subnetSet *v1alpha1.SubnetSet) (string, error)

func GetDefaultSubnetSet

func GetDefaultSubnetSet(client k8sclient.Client, ctx context.Context, namespace string, resourceType string) (*v1alpha1.SubnetSet, error)

func NodeIsMaster

func NodeIsMaster(node *v1.Node) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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