subnetset

package
v0.0.0-...-aba7421 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResultNormal            = common.ResultNormal
	ResultRequeue           = common.ResultRequeue
	ResultRequeueAfter5mins = common.ResultRequeueAfter5mins
	MetricResTypeSubnetSet  = common.MetricResTypeSubnetSet
)
View Source
var NSXOperatorSA = "system:serviceaccount:vmware-system-nsx:ncp-svc-account"
View Source
var PredicateFuncsNs = predicate.Funcs{
	CreateFunc: func(e event.CreateEvent) bool {
		return false
	},
	UpdateFunc: func(e event.UpdateEvent) bool {
		oldObj := e.ObjectOld.(*v1.Namespace)
		newObj := e.ObjectNew.(*v1.Namespace)
		log.V(1).Info("receive namespace update event", "name", oldObj.Name)
		if reflect.DeepEqual(oldObj.ObjectMeta.Labels, newObj.ObjectMeta.Labels) {
			log.Info("label of namespace is not changed, ignore it", "name", oldObj.Name)
			return false
		}
		return true
	},
	DeleteFunc: func(e event.DeleteEvent) bool {
		return false
	},
}

Functions

func StartSubnetSetController

func StartSubnetSetController(mgr ctrl.Manager, subnetService *subnet.SubnetService,
	subnetPortService servicecommon.SubnetPortServiceProvider, vpcService servicecommon.VPCServiceProvider,
	enableWebhook bool) error

Types

type EnqueueRequestForNamespace

type EnqueueRequestForNamespace struct {
	Client client.Client
}

func (*EnqueueRequestForNamespace) Create

func (*EnqueueRequestForNamespace) Delete

func (*EnqueueRequestForNamespace) Generic

func (*EnqueueRequestForNamespace) Update

type SubnetSetReconciler

type SubnetSetReconciler struct {
	Client            client.Client
	Scheme            *apimachineryruntime.Scheme
	SubnetService     *subnet.SubnetService
	SubnetPortService servicecommon.SubnetPortServiceProvider
	VPCService        servicecommon.VPCServiceProvider
	Recorder          record.EventRecorder
}

SubnetSetReconciler reconciles a SubnetSet object

func (*SubnetSetReconciler) DeleteSubnetForSubnetSet

func (r *SubnetSetReconciler) DeleteSubnetForSubnetSet(obj v1alpha1.SubnetSet, updataStatus bool) error

func (*SubnetSetReconciler) GarbageCollector

func (r *SubnetSetReconciler) GarbageCollector(cancel chan bool, timeout time.Duration)

GarbageCollector collect Subnet which there is no port attached on it. cancel is used to break the loop during UT

func (*SubnetSetReconciler) Reconcile

func (r *SubnetSetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*SubnetSetReconciler) Start

func (r *SubnetSetReconciler) Start(mgr ctrl.Manager, enableWebhook bool) error

Start setup manager

type SubnetSetValidator

type SubnetSetValidator struct {
	Client client.Client
	// contains filtered or unexported fields
}

func (*SubnetSetValidator) Handle

Handle handles admission requests.

func (*SubnetSetValidator) InjectDecoder

func (v *SubnetSetValidator) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into a validator. A decoder will be automatically injected by controller-manager.

Jump to

Keyboard shortcuts

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