Documentation ¶
Index ¶
Constants ¶
View Source
const ( LocalRunMode RunModeType = "local" ClusterRunMode RunModeType = "cluster" // OperatorNameEnvVar is the constant for env variable OPERATOR_NAME // which is the name of the current operator OperatorNameEnvVar = "OPERATOR_NAME" // WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE // which is the namespace where the watch activity happens. // this value is empty if the operator is running with clusterScope. WatchNamespaceEnvVar = "WATCH_NAMESPACE" )
Variables ¶
View Source
var ErrNoNamespace = fmt.Errorf("namespace not found for current environment")
ErrNoNamespace indicates that a namespace could not be found for the current environment
View Source
var ErrRunLocal = fmt.Errorf("operator run mode forced to local")
ErrRunLocal indicates that the operator is set to run in local mode (this error is returned by functions that only work on operators running in cluster mode)
View Source
var ForceRunModeEnv = "OSDK_FORCE_RUN_MODE"
ForceRunModeEnv indicates if the operator should be forced to run in either local or cluster mode (currently only used for local mode)
Functions ¶
func GetOperatorName ¶
GetOperatorName return the operator name
func GetOperatorNamespace ¶
GetOperatorNamespace returns the namespace the operator should be running in.
func GetOperatorNamespaceEnv ¶
GetOperatorNamespace retrieves the operator namespace from the running environment or error if unavailable
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes
Types ¶
type RunModeType ¶
type RunModeType string
Click to show internal directories.
Click to hide internal directories.