Documentation ¶
Index ¶
- func CompareChannelVersion(v1, v2 string) (v1IsLarger bool, err error)
- func CompareConfigMap(configMap *corev1.ConfigMap, existingConfigMap *corev1.ConfigMap) (needUpdate bool)
- func CompareSecret(secret *corev1.Secret, existingSecret *corev1.Secret) (needUpdate bool)
- func Contains(list []string, s string) bool
- func Differs(list []string, s string) bool
- func EnsureLabelsForConfigMap(cm *corev1.ConfigMap, labels map[string]string)
- func EnsureLabelsForRoute(r *ocproute.Route, labels map[string]string)
- func EnsureLabelsForSecret(secret *corev1.Secret, labels map[string]string)
- func EnsureLabelsForService(s *corev1.Service, labels map[string]string)
- func FindMinSemver(annotations map[string]string, curChannel string) string
- func FindSemantic(input string) string
- func GetInstallScope() string
- func GetIsolatedMode() bool
- func GetOperatorNamespace() string
- func GetWatchNamespace() string
- func GetoperatorCheckerMode() bool
- func MergeCR(defaultCR, changedCR []byte) map[string]interface{}
- func ObjectToNewUnstructured(obj interface{}) (*unstructured.Unstructured, error)
- func ResourceExists(dc discovery.DiscoveryInterface, apiGroupVersion, kind string) (bool, error)
- func ResourceNamespaced(dc discovery.DiscoveryInterface, apiGroupVersion, kind string) (bool, error)
- func SanitizeObjectString(jsonPath string, data interface{}) (string, error)
- func StringSliceContentEqual(a, b []string) bool
- func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool
- type ConfigMapRef
- type DefaultObjectRef
- type MultiErr
- type ObjectRef
- type SecretRef
- type TemplateValueRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareChannelVersion ¶
func CompareConfigMap ¶
func CompareSecret ¶
func EnsureLabelsForSecret ¶
func EnsureLabelsForService ¶
func FindMinSemver ¶ added in v4.3.4
FindMinSemver returns the minimal semantic version from annotations
func FindSemantic ¶ added in v4.3.4
FindSemantic checks if a given string contains a substring which is a valid semantic version, and returns that substring
func GetInstallScope ¶
func GetInstallScope() string
GetInstallScope returns the scope of the installation
func GetIsolatedMode ¶
func GetIsolatedMode() bool
func GetOperatorNamespace ¶
func GetOperatorNamespace() string
GetOperatorNamespace returns the Namespace of the operator
func GetWatchNamespace ¶
func GetWatchNamespace() string
GetWatchNamespace returns the Namespace of the operator
func GetoperatorCheckerMode ¶
func GetoperatorCheckerMode() bool
func ObjectToNewUnstructured ¶
func ObjectToNewUnstructured(obj interface{}) (*unstructured.Unstructured, error)
func ResourceExists ¶
func ResourceExists(dc discovery.DiscoveryInterface, apiGroupVersion, kind string) (bool, error)
ResourceExists returns true if the given resource kind exists in the given api groupversion
func ResourceNamespaced ¶
func ResourceNamespaced(dc discovery.DiscoveryInterface, apiGroupVersion, kind string) (bool, error)
ResourceNamespaced returns true if the given resource is namespaced
func SanitizeObjectString ¶
SanitizeObjectString takes a string, i.e. .metadata.namespace, and a K8s object and returns a string got from K8s object. The required string is sanitized because the values are YAML fields in a K8s object. Ensures that:
- the field actually exists, otherwise returns an error
- extracts the value from the K8s Service's field, the value will be stringified
func StringSliceContentEqual ¶
StringSliceContentEqual checks if the contant from two string slice are the same
Types ¶
type ConfigMapRef ¶
type DefaultObjectRef ¶
type DefaultObjectRef struct { Required bool `json:"required,omitempty"` ConfigMapKeyRef *ConfigMapRef `json:"configMapKeyRef,omitempty"` SecretRef *SecretRef `json:"secretKeyRef,omitempty"` // RouteRef *RouteRef `json:"routePathRef,omitempty"` ObjectRef *ObjectRef `json:"objectRef,omitempty"` DefaultValue string `json:"defaultValue,omitempty"` }
type TemplateValueRef ¶
type TemplateValueRef struct { Required bool `json:"required,omitempty"` Default *DefaultObjectRef `json:"default,omitempty"` ConfigMapKeyRef *ConfigMapRef `json:"configMapKeyRef,omitempty"` SecretRef *SecretRef `json:"secretKeyRef,omitempty"` // RouteRef *RouteRef `json:"routePathRef,omitempty"` ObjectRef *ObjectRef `json:"objectRef,omitempty"` }