cluster

package
v0.0.0-...-485f473 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MachineAPINamespace is the name of the namespace in which machine objects and userData secret is created.
	MachineAPINamespace = "openshift-machine-api"
)

Variables

View Source
var (
	// WatchedEnvironmentVars is a list of the WMCO watched environment variables
	WatchedEnvironmentVars = []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"}
)

Functions

func GetDNS

func GetDNS(subnet string) (string, error)

GetDNS parses a subnet in CIDR format as defined by RFC 4632 and RFC 4291 and returns the IP address of the Cluster DNS. Example: 172.30.0.0/16 returns 172.30.0.10

func GetProxyVars

func GetProxyVars() map[string]string

GetProxyVars returns a map of the proxy variables and values from the WMCO container's environment. The presence of any implies a proxy is enabled, as OLM would have injected them into the operator spec. Returns an empty map otherwise.

func IsProxyEnabled

func IsProxyEnabled() bool

IsProxyEnabled returns whether a global egress proxy is active in the cluster

func NewClusterNetworkCfg

func NewClusterNetworkCfg(serviceCIDR, vxlanPort string) (*clusterNetworkCfg, error)

NewClusterNetworkCfg assigns a serviceCIDR value and returns a pointer to the clusterNetworkCfg struct

func ValidateCIDR

func ValidateCIDR(cidr string) error

ValidateCIDR uses the parseCIDR from network package to validate the format of the CIDR

Types

type Config

type Config interface {
	// Validate checks if the cluster configurations are as required.
	Validate() error
	// Platform returns cloud provider on which OpenShift is running
	Platform() oconfig.PlatformType
	// Network returns network configuration for the OpenShift cluster
	Network() Network
}

Config interface contains methods to expose cluster config related information

func NewConfig

func NewConfig(restConfig *rest.Config) (Config, error)

NewConfig returns a Config struct pertaining to the cluster configuration

type Network

type Network interface {
	Validate() error
	GetServiceCIDR() string
	VXLANPort() string
}

Network interface contains methods to interact with cluster network objects

Jump to

Keyboard shortcuts

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