Documentation ¶
Index ¶
- Constants
- func BuildMainCommand(installerBinary string, pluginsList []string, batchMode bool, ...) []string
- func BuildMainCommandOSD(installerBinary string, pluginsList []string, entrypoint string) []string
- func CalculateJvmHeapSize(nodePool *opsterv1.NodePool) string
- func CheckVolumeExists(volumes []corev1.Volume, volumeMounts []corev1.VolumeMount, secretName string, ...) bool
- func ClusterDnsBase() string
- func CompareVersions(v1 string, v2 string) bool
- func ContainsString(slice []string, s string) bool
- func CountPVCsForNodePool(ctx context.Context, k8sClient client.Client, cr *opsterv1.OpenSearchCluster, ...) (int, error)
- func CountRunningPodsForNodePool(ctx context.Context, k8sClient client.Client, cr *opsterv1.OpenSearchCluster, ...) (int, error)
- func DeleteSTSForNodePool(ctx context.Context, k8sClient client.Client, nodePool opsterv1.NodePool, ...) error
- func DeleteSecurityUpdateJob(ctx context.Context, k8sClient client.Client, ...) error
- func DiffSlice(leftSlice, rightSlice []string) []string
- func FindByPath(obj interface{}, keys []string) (interface{}, bool)
- func FindFirstPartial(arr []opsterv1.ComponentStatus, item opsterv1.ComponentStatus, ...) (opsterv1.ComponentStatus, bool)
- func GetByDescriptionAndGroup(left opsterv1.ComponentStatus, right opsterv1.ComponentStatus) (opsterv1.ComponentStatus, bool)
- func GetField(v *appsv1.StatefulSetSpec, field string) interface{}
- func GetSTSForNodePool(ctx context.Context, k8sClient client.Client, nodePool opsterv1.NodePool, ...) (*appsv1.StatefulSet, error)
- func HasDataRole(nodePool *opsterv1.NodePool) bool
- func HasKeyWithBytes(data map[string][]byte, key string) bool
- func HasManagerRole(nodePool *opsterv1.NodePool) bool
- func MapClusterRole(role string, ver string) string
- func MapClusterRoles(roles []string, version string) []string
- func MergeConfigs(left map[string]string, right map[string]string) map[string]string
- func NewMockPKI() tls.PKI
- func ParallelRecoveryMode() bool
- func RemoveDuplicateStrings(strSlice []string) []string
- func RemoveIt(ss opsterv1.ComponentStatus, ssSlice []opsterv1.ComponentStatus) []opsterv1.ComponentStatus
- func Replace(remove opsterv1.ComponentStatus, add opsterv1.ComponentStatus, ...) []opsterv1.ComponentStatus
- func ResolveClusterManagerRole(ver string) string
- func ResolveDashboardsImage(cr *opsterv1.OpenSearchCluster) (result opsterv1.ImageSpec)
- func ResolveImage(cr *opsterv1.OpenSearchCluster, nodePool *opsterv1.NodePool) (result opsterv1.ImageSpec)
- func ResolveInitHelperImage(cr *opsterv1.OpenSearchCluster) (result opsterv1.ImageSpec)
- func SkipInitContainer() bool
- func SortedKeys(input map[string]string) []string
- func UsernameAndPassword(ctx context.Context, k8sClient client.Client, cr *opsterv1.OpenSearchCluster) (string, string, error)
- func VersionCheck(instance *opsterv1.OpenSearchCluster) (int32, string)
- func WaitForSTSDelete(ctx context.Context, k8sClient client.Client, obj *appsv1.StatefulSet) error
- func WaitForSTSReplicas(ctx context.Context, k8sClient client.Client, obj *appsv1.StatefulSet, ...) error
- func WaitForSTSStatus(ctx context.Context, k8sClient client.Client, obj *appsv1.StatefulSet) (*appsv1.StatefulSet, error)
- type CertMock
- func (cert *CertMock) CertData() []byte
- func (ca *CertMock) CreateAndSignCertificate(commonName string, orgUnit string, dnsnames []string) (cert tls.Cert, err error)
- func (cert *CertMock) KeyData() []byte
- func (cert *CertMock) SecretData(ca tls.Cert) map[string][]byte
- func (cert *CertMock) SecretDataCA() map[string][]byte
- type MockEventRecorder
- type PkiMock
Constants ¶
const ( DashboardConfigName = "opensearch_dashboards.yml" DashboardChecksumName = "checksum/dashboards.yml" ClusterLabel = "opster.io/opensearch-cluster" NodePoolLabel = "opster.io/opensearch-nodepool" OsUserNameAnnotation = "opensearchuser/name" OsUserNamespaceAnnotation = "opensearchuser/namespace" DnsBaseEnvVariable = "DNS_BASE" ParallelRecoveryEnabled = "PARALLEL_RECOVERY_ENABLED" SkipInitContainerEnvVariable = "SKIP_INIT_CONTAINER" )
Variables ¶
This section is empty.
Functions ¶
func BuildMainCommand ¶
func BuildMainCommandOSD ¶
func CalculateJvmHeapSize ¶
func CheckVolumeExists ¶
func ClusterDnsBase ¶
func ClusterDnsBase() string
func CompareVersions ¶
Compares whether v1 is LessThan v2
func ContainsString ¶
func CountPVCsForNodePool ¶
func CountPVCsForNodePool(ctx context.Context, k8sClient client.Client, cr *opsterv1.OpenSearchCluster, nodePool *opsterv1.NodePool) (int, error)
Count the number of PVCs created for the given NodePool
func CountRunningPodsForNodePool ¶
func CountRunningPodsForNodePool(ctx context.Context, k8sClient client.Client, cr *opsterv1.OpenSearchCluster, nodePool *opsterv1.NodePool) (int, error)
Count the number of pods running and ready and not terminating for a given nodePool
func DeleteSTSForNodePool ¶
func DeleteSTSForNodePool(ctx context.Context, k8sClient client.Client, nodePool opsterv1.NodePool, clusterName, clusterNamespace string) error
DeleteSTSForNodePool deletes the sts for the corresponding nodePool
func DeleteSecurityUpdateJob ¶
func DeleteSecurityUpdateJob(ctx context.Context, k8sClient client.Client, clusterName, clusterNamespace string) error
DeleteSecurityUpdateJob deletes the securityconfig update job
func FindByPath ¶
func FindFirstPartial ¶
func FindFirstPartial( arr []opsterv1.ComponentStatus, item opsterv1.ComponentStatus, predicator func(opsterv1.ComponentStatus, opsterv1.ComponentStatus) (opsterv1.ComponentStatus, bool), ) (opsterv1.ComponentStatus, bool)
func GetByDescriptionAndGroup ¶
func GetByDescriptionAndGroup(left opsterv1.ComponentStatus, right opsterv1.ComponentStatus) (opsterv1.ComponentStatus, bool)
func GetField ¶
func GetField(v *appsv1.StatefulSetSpec, field string) interface{}
func GetSTSForNodePool ¶
func GetSTSForNodePool(ctx context.Context, k8sClient client.Client, nodePool opsterv1.NodePool, clusterName, clusterNamespace string) (*appsv1.StatefulSet, error)
GetSTSForNodePool returns the corresponding sts for a given nodePool and cluster name
func HasDataRole ¶
func HasManagerRole ¶
func MapClusterRole ¶
Map any cluster roles that have changed between major OpenSearch versions
func MapClusterRoles ¶
func MergeConfigs ¶
func NewMockPKI ¶
func ParallelRecoveryMode ¶
func ParallelRecoveryMode() bool
func RemoveDuplicateStrings ¶
func RemoveIt ¶
func RemoveIt(ss opsterv1.ComponentStatus, ssSlice []opsterv1.ComponentStatus) []opsterv1.ComponentStatus
func Replace ¶
func Replace(remove opsterv1.ComponentStatus, add opsterv1.ComponentStatus, ssSlice []opsterv1.ComponentStatus) []opsterv1.ComponentStatus
func ResolveDashboardsImage ¶
func ResolveDashboardsImage(cr *opsterv1.OpenSearchCluster) (result opsterv1.ImageSpec)
func ResolveImage ¶
func ResolveInitHelperImage ¶
func ResolveInitHelperImage(cr *opsterv1.OpenSearchCluster) (result opsterv1.ImageSpec)
func SkipInitContainer ¶
func SkipInitContainer() bool
func SortedKeys ¶
Return the keys of the input map in sorted order Can be used if you want to iterate over a map but have a stable order
func UsernameAndPassword ¶
func VersionCheck ¶
func VersionCheck(instance *opsterv1.OpenSearchCluster) (int32, string)
Function to help identify httpPort and securityconfigPath for 1.x and 2.x OpenSearch Operator.
func WaitForSTSDelete ¶
Delete a STS with cascade=orphan and wait until it is actually deleted from the kubernetes API
func WaitForSTSReplicas ¶
func WaitForSTSReplicas(ctx context.Context, k8sClient client.Client, obj *appsv1.StatefulSet, replicas int32) error
Wait for max 30s until a STS has at least the given number of replicas
func WaitForSTSStatus ¶
func WaitForSTSStatus(ctx context.Context, k8sClient client.Client, obj *appsv1.StatefulSet) (*appsv1.StatefulSet, error)
Wait for max 30s until a STS has a normal status (CurrentRevision != "")
Types ¶
type CertMock ¶
type CertMock struct { }
func (*CertMock) CreateAndSignCertificate ¶
func (*CertMock) SecretDataCA ¶
type MockEventRecorder ¶
type MockEventRecorder struct { }
A simple mock to use whenever a record.EventRecorder is needed for a test