Documentation ¶
Index ¶
- Constants
- Variables
- func AddHashAnnotation(r Annotated)
- func AppendValuesToStringArrayIfNotPresent(a []string, values ...string) []string
- func DeepHashObject(hasher hash.Hash, objectToWrite interface{})
- func ElementsMatch(a interface{}, b interface{}) bool
- func GenerateJKS(ca *corev1.Secret, podname, dcname string) (jksblob []byte, err error)
- func GetNewCAandKey(leafdomain, namespace string) (keypem, certpem string, err error)
- func GetOperatorNamespace() (string, error)
- func GetWatchNamespace() (string, error)
- func IndexOfString(a []string, v string) int
- func MergeMap(destination map[string]string, sources ...map[string]string) map[string]string
- func RangeInt(min, max, step int) []int
- func RemoveValueFromStringArray(a []string, v string) []string
- func ResourcesHaveSameHash(r1, r2 Annotated) bool
- func SearchMap(mapToSearch map[string]interface{}, key string) map[string]interface{}
- type Annotated
- type RunModeType
- type StringSet
Constants ¶
const ResourceHashAnnotationKey = "cassandra.datastax.com/resource-hash"
const ( // 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 ¶
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)
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 AddHashAnnotation ¶
func AddHashAnnotation(r Annotated)
func DeepHashObject ¶ added in v1.13.0
DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.
func ElementsMatch ¶
func ElementsMatch(a interface{}, b interface{}) bool
func GenerateJKS ¶
func GetNewCAandKey ¶
func GetOperatorNamespace ¶
GetOperatorNamespace returns the namespace the operator should be running in.
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes
func IndexOfString ¶
func MergeMap ¶
MergeMap will take two maps, merging the entries of the source map into destination map. If both maps share the same key then destination's value for that key will be overwritten with what's in source.
func ResourcesHaveSameHash ¶
Types ¶
type RunModeType ¶
type RunModeType string
const ( LocalRunMode RunModeType = "local" ClusterRunMode RunModeType = "cluster" )