Documentation ¶
Index ¶
- func AddHashAnnotation(obj *unstructured.Unstructured, key, hash string, ...) map[string]string
- func AddObjectField(obj interface{}, jsonPath string, value interface{})
- func CalculateHash(input []byte) string
- func CalculateResHashes(fromCluster *unstructured.Unstructured, fromTemplate []byte) (string, string)
- 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 EnsureAnnotationForConfigMap(cm *corev1.ConfigMap, annotations map[string]string)
- func EnsureAnnotationsForSecret(secret *corev1.Secret, annotatinos map[string]string)
- 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 FindMaxSemver(curChannel string, semverlList []string, ...) string
- func FindMinSemver(curChannel string, semverlList []string, ...) string
- func FindMinSemverFromAnnotations(annotations map[string]string, curChannel string) string
- func FindSemantic(input string) string
- func FindSemverFromAnnotations(annotations map[string]string) ([]string, map[string]string)
- func GetFirstNCharacter(str string, n int) 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 RemoveObjectField(obj interface{}, jsonPath string)
- 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 AddHashAnnotation ¶ added in v4.3.6
func AddHashAnnotation(obj *unstructured.Unstructured, key, hash string, newAnnotations map[string]string) map[string]string
SetHashAnnotation sets the hash annotation in the object
func AddObjectField ¶ added in v4.3.6
func AddObjectField(obj interface{}, jsonPath string, value interface{})
AddObjectField adds the field to the object according to the jsonPath jsonPath is a string that represents the path to the field in the object, always starts with "."
func CalculateHash ¶ added in v4.3.6
CalculateHash calculates the hash value for single resource
func CalculateResHashes ¶ added in v4.3.6
func CalculateResHashes(fromCluster *unstructured.Unstructured, fromTemplate []byte) (string, string)
CalculateResHashes calculates the hash for the existing cluster resource and the new template resource
func CompareChannelVersion ¶
func CompareConfigMap ¶
func CompareSecret ¶
func EnsureAnnotationForConfigMap ¶ added in v4.3.7
func EnsureAnnotationsForSecret ¶ added in v4.3.7
func EnsureLabelsForSecret ¶
func EnsureLabelsForService ¶
func FindMaxSemver ¶ added in v4.3.5
func FindMaxSemver(curChannel string, semverlList []string, semVerChannelMappings map[string]string) string
FindMaxSemver returns the maximal semantic version by given channel and semver list
func FindMinSemver ¶ added in v4.3.4
func FindMinSemver(curChannel string, semverlList []string, semVerChannelMappings map[string]string) string
FindMinSemver returns the minimal semantic version by given channel and semver list
func FindMinSemverFromAnnotations ¶ added in v4.3.5
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 FindSemverFromAnnotations ¶ added in v4.3.5
func GetFirstNCharacter ¶ added in v4.3.7
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 RemoveObjectField ¶ added in v4.3.6
func RemoveObjectField(obj interface{}, jsonPath string)
RemoveObjectField removes the field from the object according to the jsonPath jsonPath is a string that represents the path to the field in the object, always starts with "."
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"` }