Documentation ¶
Index ¶
- Constants
- func GetNamespace() (string, error)
- func GetOperatorNamespace() (string, error)
- func GetWatchNamespace() (string, error)
- func Initialize() error
- func InitializeForTesting(currentInfrastructure Type)
- func IsInitialized() bool
- func IsOpenShift() bool
- func IsWebhookConfigurationEnabled() (bool, error)
- type Type
Constants ¶
const (
WatchNamespaceEnvVar = "WATCH_NAMESPACE"
)
Variables ¶
This section is empty.
Functions ¶
func GetNamespace ¶ added in v0.10.0
GetNamespace gets the namespace of the operator by checking GetOperatorNamespace and GetWatchNamespace in that order. Returns an error if both GetOperatorNamespace and GetWatchNamespace return an error.
func GetOperatorNamespace ¶
GetOperatorNamespace returns the namespace the operator should be running in.
This function was ported over from Operator SDK 0.17.0 and modified.
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes
This function was ported over from Operator SDK 0.17.0
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 IsInitialized ¶ added in v0.17.0
func IsInitialized() bool
func IsOpenShift ¶
func IsOpenShift() bool
IsOpenShift returns true if the current cluster is an OpenShift (v4.x) cluster.
func IsWebhookConfigurationEnabled ¶
IsWebhookConfigurationEnabled returns true if both of mutating and validating webhook configurations are enabled