Documentation
¶
Index ¶
- Variables
- func CheckMultiInstances(r client.Reader) (enable bool)
- func CheckSaas(r client.Reader) (enable bool)
- func CheckStorageClass(r client.Reader) error
- func CompareObj(newObj *unstructured.Unstructured, existingObj *unstructured.Unstructured) (needUpdate bool)
- func CompareVersion(v1, v2 string) (v1IsLarger bool, err error)
- func Contains(list []string, s string) bool
- func EncodeBase64(data []byte) string
- func EnsureLabels(resource *unstructured.Unstructured, labels map[string]string)
- func EnsureLabelsForConfigMap(cm *corev1.ConfigMap, labels map[string]string)
- func EnsureLabelsForCsCR(cs *apiv3.CommonService, labels map[string]string)
- func GetApprovalModeinNs(r client.Reader, ns string) (approvalMode string, err error)
- func GetCPFSNamespace(r client.Reader) (cpfsNamespace string)
- func GetCatalogSource(packageName, ns string, r client.Reader) (CatalogSourceName, CatalogSourceNS string)
- func GetCmOfMapCs(r client.Reader) (*corev1.ConfigMap, error)
- func GetCmOfNss(r client.Reader, operatorNs string) (*corev1.ConfigMap, error)
- func GetControlNs(r client.Reader) (controlNs string)
- func GetCsScope(cm *corev1.ConfigMap, cpfsNamespace string) ([]string, error)
- func GetEnableOpreqWebhook() bool
- func GetFirstNCharacter(str string, n int) string
- func GetImage(imageName string) string
- func GetNSSCMSynchronization() bool
- func GetNssCmNs(r client.Reader, cpfsNamespace string) ([]string, error)
- func GetOperatorName() (string, error)
- func GetOperatorNamespace() (string, error)
- func GetPackageNameByServiceName(opreg *odlm.OperandRegistry, operatorName string) string
- func GetRequestNs(r client.Reader) (requestNs []string)
- func GetResourcesDynamically(ctx context.Context, dynamic dynamic.Interface, group string, version string, ...) ([]unstructured.Unstructured, error)
- func GetServicesNamespace(r client.Reader) (servicesNamespace string)
- func GetUtilsImage() string
- func GetWatchNamespace() string
- func Namespacelize(resource, placeholder, ns string) string
- func NewCSCache(watchNamespaceList []string, opts ctrl.Options) ctrl.Options
- func NewUnstructured(group, kind, version string) *unstructured.Unstructured
- func NewUnstructuredList(group, kind, version string) *unstructured.UnstructuredList
- func ObjectListToNewUnstructuredList(objs interface{}) (*unstructured.UnstructuredList, error)
- func ReadFile(path string) ([]byte, error)
- func ReplaceImages(resource string) (result string)
- func Reverse(original []string) []string
- func SanitizeData(data interface{}, valueType string, isEmpty bool) interface{}
- func UpdateAllNSList(r client.Reader, c client.Client, cm *corev1.ConfigMap, nssKey, nssNs string) error
- func UpdateCsMaps(cm *corev1.ConfigMap, requestNsList, servicesNS, operatorNs string) error
- func UpdateNSList(r client.Reader, c client.Client, cm *corev1.ConfigMap, ...) error
- func UpdateOpRegUserManaged(opreg *odlm.OperandRegistry, operatorName string, value bool) error
- func ValidateCsMaps(cm *corev1.ConfigMap) error
- func YamlToObject(yamlContent []byte) (*unstructured.Unstructured, error)
- func YamlToObjects(yamlContent []byte) ([]*unstructured.Unstructured, error)
- type CsMaps
- type NsMapping
Constants ¶
This section is empty.
Variables ¶
var (
ImageList = []string{"IBM_SECRETSHARE_OPERATOR_IMAGE", "IBM_CS_WEBHOOK_IMAGE"}
)
Functions ¶
func CheckMultiInstances ¶
CheckMultiInstance checks whether it is a MultiInstances including SaaS and on-prem MultiInstances
func CheckStorageClass ¶
CheckStorageClass gets StorageClassList in current cluster, then validates whether StorageClass created
func CompareObj ¶
func CompareObj(newObj *unstructured.Unstructured, existingObj *unstructured.Unstructured) (needUpdate bool)
func CompareVersion ¶
CompareVersion takes vx.y.z, vx.y.z -> bool: if v1 is larger than v2
func EncodeBase64 ¶
EncodeBase64 encodes data to base64 string
func EnsureLabels ¶
func EnsureLabels(resource *unstructured.Unstructured, labels map[string]string)
EnsureLabels ensures that the specifc resource has the certain labels
func EnsureLabelsForConfigMap ¶
EnsureLabelsForConfigMap ensures that the specifc ConfigMap has the certain labels
func EnsureLabelsForCsCR ¶
func EnsureLabelsForCsCR(cs *apiv3.CommonService, labels map[string]string)
EnsureLabelsForConfigMap ensures that the specifc ConfigMap has the certain labels
func GetApprovalModeinNs ¶
func GetCPFSNamespace ¶
GetCPFSNamespace returns the namespace where foundational services operator should be running
func GetCatalogSource ¶
func GetCatalogSource(packageName, ns string, r client.Reader) (CatalogSourceName, CatalogSourceNS string)
GetCatalogSource gets CatalogSource will be used by operators
func GetCmOfMapCs ¶
GetCmOfMapCs gets ConfigMap of Common Services Maps
func GetCmOfNss ¶
GetCmOfNss gets ConfigMap of Namespace-scope
func GetControlNs ¶
GetControlNs gets control namespace of deploying cluster scope services
func GetCsScope ¶
GetCsScope fetchs the namespaces from its own requested-from-namespace and map-to-common-service-namespace
func GetEnableOpreqWebhook ¶
func GetEnableOpreqWebhook() bool
GetEnableOpreqWebhook check if enable the webhook for the OperandRequest
func GetFirstNCharacter ¶
func GetNSSCMSynchronization ¶
func GetNSSCMSynchronization() bool
GetNSSCMSynchronization returns whether NSS ConfigMap shchronization with OperatorGroup is enabled
func GetNssCmNs ¶
GetNssCmNs gets namespaces from namespace-scope ConfigMap
func GetOperatorName ¶
GetOperatorName return the operator name
func GetOperatorNamespace ¶
GetOperatorNamespace returns the namespace the operator should be running in.
func GetPackageNameByServiceName ¶
func GetPackageNameByServiceName(opreg *odlm.OperandRegistry, operatorName string) string
func GetRequestNs ¶
GetRequestNs gets requested-from-namespace of map-to-common-service-namespace
func GetResourcesDynamically ¶
func GetResourcesDynamically(ctx context.Context, dynamic dynamic.Interface, group string, version string, resource string) ( []unstructured.Unstructured, error)
func GetServicesNamespace ¶
GetServicesNamespace returns the namespace where foundational services CRs should be running
func GetUtilsImage ¶ added in v4.12.0
func GetUtilsImage() string
func GetWatchNamespace ¶
func GetWatchNamespace() string
GetWatchNamespace returns the list of namespaces that the operator watches
func Namespacelize ¶
Namespacelize adds the namespace specified
func NewCSCache ¶
NewCSCache implements a customized cache with a for CS
func NewUnstructured ¶
func NewUnstructured(group, kind, version string) *unstructured.Unstructured
NewUnstructured return Unstructured object
func NewUnstructuredList ¶
func NewUnstructuredList(group, kind, version string) *unstructured.UnstructuredList
NewUnstructuredList return UnstructuredList object
func ObjectListToNewUnstructuredList ¶
func ObjectListToNewUnstructuredList(objs interface{}) (*unstructured.UnstructuredList, error)
func ReplaceImages ¶
func SanitizeData ¶
SanitizeData keep the key-value pair in the map if the value fulfill the valueType and requirement
func UpdateAllNSList ¶
func UpdateAllNSList(r client.Reader, c client.Client, cm *corev1.ConfigMap, nssKey, nssNs string) error
UpdateAllNSList updates all adopter and CS namespaces into NSS CR
func UpdateCsMaps ¶
UpdateCsMaps will update namespaceMapping in common-service-maps
func UpdateNSList ¶
func UpdateNSList(r client.Reader, c client.Client, cm *corev1.ConfigMap, nssKey, cpfsNamespace string, addControlNs bool) error
UpdateNSList updates adopter namespaces of Common Services
func UpdateOpRegUserManaged ¶
func UpdateOpRegUserManaged(opreg *odlm.OperandRegistry, operatorName string, value bool) error
func ValidateCsMaps ¶
ValidateCsMaps checks common-service-maps has no scope overlapping
func YamlToObject ¶
func YamlToObject(yamlContent []byte) (*unstructured.Unstructured, error)
YamlToObject converting large yaml file, we can remove it after using "apimachinery" v0.19.0
func YamlToObjects ¶
func YamlToObjects(yamlContent []byte) ([]*unstructured.Unstructured, error)
YamlToObjects convert YAML content to unstructured objects