clusterdiscovery

package
v0.0.0-...-03871d1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CSIManifestEnvVar = "TEST_CSI_DRIVER_FILES"
	OCPManifestEnvVar = "TEST_OCP_CSI_DRIVER_FILES"
)

Variables

This section is empty.

Functions

func InitCSITests

func InitCSITests() error

InitCSITests initializes the openshift/csi suite, i.e. define CSI tests from TEST_CSI_DRIVER_FILES.

func InitializeTestFramework

func InitializeTestFramework(context *e2e.TestContextType, config *ClusterConfiguration, dryRun bool) error

Types

type ClusterConfiguration

type ClusterConfiguration struct {
	ProviderName string `json:"type"`

	// These fields (and the "type" tag for ProviderName) chosen to match
	// upstream's e2e.CloudConfig.
	ProjectID   string
	Region      string
	Zone        string
	NumNodes    int
	MultiMaster bool
	MultiZone   bool
	Zones       []string
	ConfigFile  string

	// Disconnected is set for test jobs without external internet connectivity
	Disconnected bool

	// SingleReplicaTopology is set for disabling disruptive tests or tests
	// that require high availability
	SingleReplicaTopology bool

	// NetworkPlugin is the "official" plugin name
	NetworkPlugin string
	// NetworkPluginMode is an optional sub-identifier for the NetworkPlugin.
	// (Currently it is only used for OpenShiftSDN.)
	NetworkPluginMode string `json:",omitempty"`

	// HasIPv4 and HasIPv6 determine whether IPv4-specific, IPv6-specific,
	// and dual-stack-specific tests are run
	HasIPv4 bool
	HasIPv6 bool
	// IPFamily defines default IP stack of the cluster, replaces upstream getDefaultClusterIPFamily
	IPFamily string

	// HasSCTP determines whether SCTP connectivity tests can be run in the cluster
	HasSCTP bool

	// IsProxied determines whether we are accessing the cluster through an HTTP proxy
	IsProxied bool

	// IsIBMROKS determines whether the cluster is Managed IBM Cloud (ROKS)
	IsIBMROKS bool

	// IsNoOptionalCapabilities indicates the cluster has no optional capabilities enabled
	HasNoOptionalCapabilities bool

	// HypervisorConfig contains SSH configuration for hypervisor-based recovery operations
	HypervisorConfig *HypervisorConfig

	// APIGroups contains the set of API groups available in the cluster
	APIGroups sets.Set[string] `json:"-"`
	// EnabledFeatureGates contains the set of enabled feature gates in the cluster
	EnabledFeatureGates sets.Set[string] `json:"-"`
	// DisabledFeatureGates contains the set of disabled feature gates in the cluster
	DisabledFeatureGates sets.Set[string] `json:"-"`
}

func DecodeProvider

func DecodeProvider(providerTypeOrJSON string, dryRun, discover bool, clusterState *ClusterState) (*ClusterConfiguration, error)

func LoadConfig

func LoadConfig(state *ClusterState) (*ClusterConfiguration, error)

LoadConfig generates a ClusterConfiguration based on a detected or hard-coded ClusterState

func (*ClusterConfiguration) ToJSONString

func (c *ClusterConfiguration) ToJSONString() string

type ClusterState

type ClusterState struct {
	APIURL               *url.URL
	PlatformStatus       *configv1.PlatformStatus
	Masters              *corev1.NodeList
	NonMasters           *corev1.NodeList
	NetworkSpec          *operatorv1.NetworkSpec
	ControlPlaneTopology *configv1.TopologyMode
	OptionalCapabilities []configv1.ClusterVersionCapability
	Version              *configv1.ClusterVersion
	APIGroups            sets.Set[string]
	EnabledFeatureGates  sets.Set[string]
	DisabledFeatureGates sets.Set[string]
}

ClusterState provides information about the cluster that is used to generate ClusterConfiguration

func DiscoverClusterState

func DiscoverClusterState(clientConfig *rest.Config) (*ClusterState, error)

DiscoverClusterState creates a ClusterState based on a live cluster

type HypervisorConfig

type HypervisorConfig struct {
	HypervisorIP   string `json:"hypervisorIP"`
	SSHUser        string `json:"sshUser"`
	PrivateKeyPath string `json:"privateKeyPath"`
}

HypervisorConfig contains configuration for hypervisor-based recovery operations

Jump to

Keyboard shortcuts

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