controller

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright 2025, NVIDIA CORPORATION & AFFILIATES

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package controller is a generated GoMock package.

Index

Constants

View Source
const (
	RailPodID = "rail_pod_id"
)

Variables

This section is empty.

Functions

func GenerateUint64FromString added in v0.0.2

func GenerateUint64FromString(input string) uint64

GenerateUint64FromString hashes a string and returns a uint64

Types

type FlowReconciler

type FlowReconciler struct {
	NodeName string
	client.Client
	Exec       exec.API
	Flows      FlowsAPI
	OVSWatcher <-chan event.TypedGenericEvent[struct{}]
}

FlowReconciler reconciles a Pod object

func (*FlowReconciler) Reconcile

func (r *FlowReconciler) Reconcile(ctx context.Context, pod *corev1.Pod) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the Pod object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.17.3/pkg/reconcile

func (*FlowReconciler) SetupWithManager

func (r *FlowReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type Flows added in v0.0.2

type Flows struct {
	Exec       exec.API
	NetlinkLib libnetlink.NetlinkLib
}

func (*Flows) AddPodRailFlows added in v0.0.2

func (f *Flows) AddPodRailFlows(cookie uint64, vf, bridge, podIP, podMAC string) error

func (*Flows) CleanupStaleFlowsForBridges added in v0.1.2

func (f *Flows) CleanupStaleFlowsForBridges(ctx context.Context, existingPodUIDs map[string]bool) error

func (*Flows) DeletePodRailFlows added in v0.0.2

func (f *Flows) DeletePodRailFlows(cookie uint64, podID string) error

func (*Flows) IsBridgeManagedByRailCNI added in v0.1.1

func (f *Flows) IsBridgeManagedByRailCNI(bridge, podID string) (bool, error)

type FlowsAPI added in v0.0.2

type FlowsAPI interface {
	AddPodRailFlows(cookie uint64, vf, bridge, podIP, podMAC string) error
	DeletePodRailFlows(cookie uint64, podID string) error
	IsBridgeManagedByRailCNI(bridge, podID string) (bool, error)
	CleanupStaleFlowsForBridges(ctx context.Context, existingPodUIDs map[string]bool) error
}

type MockFlowsAPI added in v0.0.2

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

MockFlowsAPI is a mock of FlowsAPI interface.

func NewMockFlowsAPI added in v0.0.2

func NewMockFlowsAPI(ctrl *gomock.Controller) *MockFlowsAPI

NewMockFlowsAPI creates a new mock instance.

func (*MockFlowsAPI) AddPodRailFlows added in v0.0.2

func (m *MockFlowsAPI) AddPodRailFlows(cookie uint64, vf, bridge, podIP, podMAC string) error

AddPodRailFlows mocks base method.

func (*MockFlowsAPI) CleanupStaleFlowsForBridges added in v0.1.2

func (m *MockFlowsAPI) CleanupStaleFlowsForBridges(ctx context.Context, existingPodUIDs map[string]bool) error

CleanupStaleFlowsForBridges mocks base method.

func (*MockFlowsAPI) DeletePodRailFlows added in v0.0.2

func (m *MockFlowsAPI) DeletePodRailFlows(cookie uint64, podID string) error

DeletePodRailFlows mocks base method.

func (*MockFlowsAPI) EXPECT added in v0.0.2

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFlowsAPI) IsBridgeManagedByRailCNI added in v0.1.1

func (m *MockFlowsAPI) IsBridgeManagedByRailCNI(bridge, podID string) (bool, error)

IsBridgeManagedByRailCNI mocks base method.

type MockFlowsAPIMockRecorder added in v0.0.2

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

MockFlowsAPIMockRecorder is the mock recorder for MockFlowsAPI.

func (*MockFlowsAPIMockRecorder) AddPodRailFlows added in v0.0.2

func (mr *MockFlowsAPIMockRecorder) AddPodRailFlows(cookie, vf, bridge, podIP, podMAC interface{}) *gomock.Call

AddPodRailFlows indicates an expected call of AddPodRailFlows.

func (*MockFlowsAPIMockRecorder) CleanupStaleFlowsForBridges added in v0.1.2

func (mr *MockFlowsAPIMockRecorder) CleanupStaleFlowsForBridges(ctx, existingPodUIDs interface{}) *gomock.Call

CleanupStaleFlowsForBridges indicates an expected call of CleanupStaleFlowsForBridges.

func (*MockFlowsAPIMockRecorder) DeletePodRailFlows added in v0.0.2

func (mr *MockFlowsAPIMockRecorder) DeletePodRailFlows(cookie, podID interface{}) *gomock.Call

DeletePodRailFlows indicates an expected call of DeletePodRailFlows.

func (*MockFlowsAPIMockRecorder) IsBridgeManagedByRailCNI added in v0.1.1

func (mr *MockFlowsAPIMockRecorder) IsBridgeManagedByRailCNI(bridge, podID interface{}) *gomock.Call

IsBridgeManagedByRailCNI indicates an expected call of IsBridgeManagedByRailCNI.

Jump to

Keyboard shortcuts

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