Documentation ¶
Index ¶
- Constants
- Variables
- func ClusterHasOpenShiftConfigGroupVerison(dc *discovery.DiscoveryClient) (found bool)
- func ClusterHasRouteGroupVersion(dc *discovery.DiscoveryClient) (found bool)
- func ClusterHasZenExtensionGroupVersion(dc *discovery.DiscoveryClient) (found bool)
- func GenerateRandomString(rule string) string
- func GetControllerKind(controlled client.Object) (kind string)
- func GetControllerRefIndex(controlled client.Object) (index int)
- func GetCsConfigAnnotation(namespace string) string
- func GetImageRef(envVar string) string
- func GetOperatorNamespace() (string, error)
- func GetServicesNamespace(ctx context.Context, k8sClient *client.Client) (namespace string, err error)
- func GetWatchNamespace() (string, error)
- func IsControllerOf(controller, controlled client.Object) (isController bool)
- func IsCsConfigAnnotationExists(annotations map[string]string) bool
- func IsOwnerOf(owner, owned client.Object) (isOwner bool)
- func MergeMap(in map[string]string, mergeMap map[string]string) map[string]string
- func ReduceSubreconcilerResultsAndErrors(results []*ctrl.Result, errs []error) (result *ctrl.Result, err error)
- type ClusterType
- type DeploymentName
- type RunModeType
Constants ¶
const ( // ForceRunModeEnv indicates if the operator should be forced to run in either local // or cluster mode (currently only used for local mode) ForceRunModeEnv string = "OSDK_FORCE_RUN_MODE" // ForceOperatorNsEnv provides an override value to indicate which namespace the Operator is running in; this is // largely meant for testing purposes (e.g. with envtest) ForceOperatorNsEnv string = "FORCE_OPERATOR_NS" )
const CommonServiceName string = "common-service"
const DatastoreEDBCMName string = "im-datastore-edb-cm"
Name of ConfigMap that configures external or embedded EDB for IM
const DatastoreEDBCSName string = "im-common-service"
Name of CommonService created by IM Operator to provision EDB share
const DatastoreEDBSecretName string = "im-datastore-edb-secret"
Name of Secret containing certificates for connecting to EDB
const GlobalConfigMapName string = "ibm-cpp-config"
const MongoOprDeploymentName string = "ibm-mongodb-operator"
Name of the mongodb operator deployment name
const MongoStatefulsetName string = "icp-mongodb"
Name of the mongodb statefulset name
Variables ¶
var CsConfigAnnotationSuffix = "common-service/config"
var CsDefaultNamespace = "ibm-common-services"
var ErrNoNamespace = fmt.Errorf("namespace not found for current environment")
ErrNoNamespace indicates that a namespace could not be found for the current environment
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)
Functions ¶
func ClusterHasOpenShiftConfigGroupVerison ¶
func ClusterHasOpenShiftConfigGroupVerison(dc *discovery.DiscoveryClient) (found bool)
func ClusterHasRouteGroupVersion ¶
func ClusterHasRouteGroupVersion(dc *discovery.DiscoveryClient) (found bool)
func ClusterHasZenExtensionGroupVersion ¶
func ClusterHasZenExtensionGroupVersion(dc *discovery.DiscoveryClient) (found bool)
func GenerateRandomString ¶
GenerateRandomString generates a random string based upon a string that is a valid regex pattern.
func GetControllerKind ¶
func GetControllerRefIndex ¶
func GetCsConfigAnnotation ¶
GetCsConfigAnnotation returns '<namespace>.common-service/config' annotation name for given namespace
func GetImageRef ¶
func GetOperatorNamespace ¶
GetOperatorNamespace returns the namespace the Operator should be running in.
func GetServicesNamespace ¶
func GetServicesNamespace(ctx context.Context, k8sClient *client.Client) (namespace string, err error)
GetServicesNamespace finds the namespace that contains the shared services by listing all Authentications in all namespaces where the Operator has visibility. There should only ever be one Authentication CR for a given IM Operator instance, so wherever that one Authentication CR is found is assumed to be where the other Operands are. If no or more than one Authentication CR is found, an error is reported as this is an unsupported usage of the CR.
func GetWatchNamespace ¶
GetWatchNamespace returns the Namespace the operator should be watching for changes
func IsControllerOf ¶
IsControllerOf determines whether one object is listed as the controller of another object within its OwnerReferences.
func IsCsConfigAnnotationExists ¶
IsCsConfigAnnotationExists checks if '<namespace>.common-service/config' annotation name exists in the given annotations map or not
func IsOwnerOf ¶
IsOwnerOf determines whether one object is listed in another object's OwnerReferences.
func ReduceSubreconcilerResultsAndErrors ¶
func ReduceSubreconcilerResultsAndErrors(results []*ctrl.Result, errs []error) (result *ctrl.Result, err error)
ReduceSubreconcilerResultsAndErrors takes a slice of Result pointers and a slice of errors and reduces them to a single Result pointer and error to be used in a subreconciler.Evaluate call.
Types ¶
type ClusterType ¶
type ClusterType int64
const ( Unknown ClusterType = iota OpenShift CNCF )
func GetClusterType ¶
func GetClusterType(ctx context.Context, k8sClient *client.Client, cmName string) (clusterType ClusterType, err error)
GetClusterType attempts to determine whether the Operator is running on Openshift versus a CNCF cluster. Exits in the event that the cluster config can't be obtained to make queries or if the watch namespace can't be obtained.
func (ClusterType) String ¶
func (ct ClusterType) String() string
type DeploymentName ¶
type DeploymentName string
const ( PlatformIdentityProvider DeploymentName = "platform-identity-provider" PlatformIdentityManagement DeploymentName = "platform-identity-management" PlatformAuthService DeploymentName = "platform-auth-service" )
The current names of Deployments managed by this Operator
type RunModeType ¶
type RunModeType string
const ( LocalRunMode RunModeType = "local" ClusterRunMode RunModeType = "cluster" )