infrastructure

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnsupportedClusterError = errors.New("running on unsupported cluster")
)

Functions

func InitKcpControllerContext added in v0.8.0

func InitKcpControllerContext(ctx context.Context, req ctrl.Request) context.Context

func Initialize

func Initialize() error

Initialize attempts to determine the type of cluster its currently running on (OpenShift or Kubernetes). This function *must* be called before others; otherwise the call will panic.

func InitializeForTesting

func InitializeForTesting(currentInfrastructure Type)

InitializeForTesting is used to mock running on a specific type of cluster (Kubernetes, OpenShift) in testing code.

func IsKcp added in v0.7.3

func IsKcp(restConfig *rest.Config) (bool, error)

func IsOpenShift

func IsOpenShift() bool

IsOpenShift returns true if the current cluster is an OpenShift (v4.x) cluster.

func NewKcpManager added in v0.7.3

func NewKcpManager(ctx context.Context, restConfig *rest.Config, options ctrl.Options, apiExportName string) (manager.Manager, error)

func NoVirtualWorkspaceError added in v0.7.3

func NoVirtualWorkspaceError(apiExport string) error

Types

type Type

type Type int

Type specifies what kind of infrastructure we're operating in.

const (
	// Unsupported represents an Unsupported cluster version (e.g. OpenShift v3)
	Unsupported Type = iota
	Kubernetes
	OpenShiftv4
)

Jump to

Keyboard shortcuts

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