networkmanager

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package networkmanager parses and resolves network manager registrations (network manager integration contract §4.2). A manager registers with one immutable ConfigMap in the operator namespace, labelled osac.openshift.io/network-fabric-manager or osac.openshift.io/network-k8s-manager. Discovery.Resolve resolves the managers a NetworkClass selects and returns the error message the NetworkClass reports when resolution fails.

Index

Constants

View Source
const (
	// LabelFabricManager is the label key that identifies a ConfigMap as a Fabric Manager registration.
	LabelFabricManager = "osac.openshift.io/network-fabric-manager"
	// LabelK8sManager is the label key that identifies a ConfigMap as a Kubernetes Manager registration.
	LabelK8sManager = "osac.openshift.io/network-k8s-manager"
	// LabelValue is the value of a registration label.
	LabelValue = "true"

	// DataKeyName is the registration name a NetworkClass selects.
	DataKeyName = "name"
	// DataKeyAnsibleRole is the fully qualified Ansible role of the manager.
	DataKeyAnsibleRole = "ansible_role"
	// DataKeyDescription is optional free text.
	DataKeyDescription = "description"
	// DataKeyCapabilities is the comma-separated capability list.
	DataKeyCapabilities = "capabilities"
	// DataKeyNetworkTypes is the comma-separated network type list (Fabric only).
	DataKeyNetworkTypes = "network_types"
	// DataKeyNetworkType is the network type of a Kubernetes Manager.
	DataKeyNetworkType = "network_type"

	// CapabilityEastWestEthernet means the Fabric Manager implements the FabricDomain tasks.
	CapabilityEastWestEthernet = "eastWestEthernet"
	// CapabilitySecurityGroupICMP means the manager's create_security_group accepts icmp rules.
	CapabilitySecurityGroupICMP = "security_group_icmp"
	// NetworkTypeEVPN is the only network type of this release.
	NetworkTypeEVPN = "evpn"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

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

Discovery finds manager registrations in the operator namespace.

func NewDiscovery

func NewDiscovery(reader client.Reader, namespace string) (*Discovery, error)

NewDiscovery creates a Discovery that reads registrations in namespace.

func (*Discovery) Find added in v0.0.40

func (d *Discovery) Find(ctx context.Context, name string, managerType ManagerType) (*Manager, error)

Find returns the registration of the given type whose data.name is name. Only the matching registration is validated, so a bad unrelated registration never fails the lookup.

func (*Discovery) Resolve added in v0.0.40

func (d *Discovery) Resolve(ctx context.Context, fabricName, k8sName string, eastWestEthernet bool) (*Resolution, error)

Resolve resolves the managers a NetworkClass selects (contract §4.2). k8sName may be empty. eastWestEthernet is the NetworkClass supports_east_west_ethernet setting.

type Manager

type Manager struct {
	Name         string
	AnsibleRole  string
	Description  string
	Capabilities []string
	NetworkTypes []string
	NetworkType  string
	Type         ManagerType
	ConfigMapRef types.NamespacedName
}

Manager is a parsed and validated manager registration (contract §4.2).

func ParseConfigMap

func ParseConfigMap(cm *corev1.ConfigMap, managerType ManagerType) (*Manager, error)

ParseConfigMap validates a registration ConfigMap as a manager of the given type. It does not check the labels; Find does.

func (*Manager) HasCapability

func (m *Manager) HasCapability(capability string) bool

HasCapability reports whether the manager declares the capability.

func (*Manager) HasNetworkType added in v0.0.40

func (m *Manager) HasNetworkType(networkType string) bool

HasNetworkType reports whether a Fabric Manager declares the network type.

type ManagerType

type ManagerType string

ManagerType is the manager type; its value is osac_job_vars.manager.type.

const (
	// FabricManager configures the provider fabric.
	FabricManager ManagerType = "fabric"
	// KubernetesManager configures hub networking (OSAC's own managers).
	KubernetesManager ManagerType = "kubernetes"
)

func (ManagerType) Label added in v0.0.40

func (t ManagerType) Label() string

Label returns the registration label key of the manager type.

type Resolution added in v0.0.40

type Resolution struct {
	Fabric      *Manager
	Kubernetes  *Manager // nil without a Kubernetes Manager
	NetworkType string   // empty without a Kubernetes Manager
}

Resolution is the result of resolving a NetworkClass.

func (*Resolution) SecurityGroupICMP added in v0.0.40

func (r *Resolution) SecurityGroupICMP() bool

SecurityGroupICMP reports whether every resolved manager declares security_group_icmp.

Jump to

Keyboard shortcuts

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