api

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkTopologySourceLabelKey = "volcano.sh/network-topology-source"
	DefaultDiscoveryInterval      = time.Hour
)

Variables

This section is empty.

Functions

func RegisterDiscoverer

func RegisterDiscoverer(source string, constructor DiscovererConstructor)

RegisterDiscoverer registers a discoverer constructor for a given source

Types

type Credentials

type Credentials struct {
	SecretRef *SecretRef `json:"secretRef" yaml:"secretRef"`
}

Credentials specifies how to retrieve credentials

type Discoverer

type Discoverer interface {
	// Start begins the discovery process, sending discovered nodes through the provided channel
	Start() (chan []*topologyv1alpha1.HyperNode, error)

	// Stop halts the discovery process
	Stop() error

	// Name returns the discoverer identifier, this is used for labeling discovered hyperNodes for distinction.
	Name() string

	// ResultSynced the manager must call this method to notice the topology discovery results have been processed
	ResultSynced()
}

Discoverer is the interface for network topology discovery, every discoverer should implement this interface and return the discovered hyperNodes

func NewDiscoverer

func NewDiscoverer(cfg DiscoveryConfig, kubeClient clientset.Interface, vcClient vcclientset.Interface) (Discoverer, error)

NewDiscoverer creates a new discoverer instance based on source

type DiscovererConstructor

type DiscovererConstructor func(cfg DiscoveryConfig, kubeClient clientset.Interface, vcClient vcclientset.Interface) Discoverer

DiscovererConstructor is a function type used to create instances of specific discoverer source

type DiscoveryConfig

type DiscoveryConfig struct {
	// Source specifies the discover source (e.g., "ufm", "roce", etc.)
	Source string `json:"source" yaml:"source"`

	// Enabled determines if discovery for this source is active
	Enabled bool `json:"enabled" yaml:"enabled"`

	// Interval is the period between topology discovery operations
	// If not specified, DefaultDiscoveryInterval will be used
	Interval time.Duration `json:"interval" yaml:"interval"`

	// Credentials specifies the username/password to access the discovery source
	Credentials *Credentials `json:"credentials" yaml:"credentials"`

	// Config contains specific configuration parameters for each discovery source
	Config map[string]interface{} `json:"config" yaml:"config"`
}

DiscoveryConfig contains configuration for a specific discovery source

type NetworkTopologyConfig

type NetworkTopologyConfig struct {
	// NetworkTopologyDiscovery specifies the network topology to discover,
	// each discovery source has its own specific configuration
	NetworkTopologyDiscovery []DiscoveryConfig `json:"networkTopologyDiscovery" yaml:"networkTopologyDiscovery"`
}

NetworkTopologyConfig represents the configuration for network topology

func (*NetworkTopologyConfig) GetDiscoveryConfig

func (c *NetworkTopologyConfig) GetDiscoveryConfig(source string) *DiscoveryConfig

GetDiscoveryConfig returns the configuration for a specific discovery source Returns nil if the discovery source is not found or not enabled

func (*NetworkTopologyConfig) GetEnabledDiscoverySources

func (c *NetworkTopologyConfig) GetEnabledDiscoverySources() []string

GetEnabledDiscoverySources returns a list of enabled discovery sources

type SecretRef

type SecretRef struct {
	Name      string `json:"name" yaml:"name"`
	Namespace string `json:"namespace" yaml:"namespace"`
}

SecretRef refers to a secret containing sensitive information

Jump to

Keyboard shortcuts

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