Documentation ¶
Index ¶
- Constants
- func BuildMainCommand(installerBinary string, pluginsList []string, batchMode bool, ...) []string
- func BuildMainCommandOSD(installerBinary string, pluginsList []string, entrypoint string) []string
- func CalculateJvmHeapSize(nodePool *eliatrav1.NodePool) string
- func CheckVolumeExists(volumes []corev1.Volume, volumeMounts []corev1.VolumeMount, secretName string, ...) bool
- func ClusterDnsBase() string
- func CompareVersions(v1 string, v2 string) bool
- func ComponentStatusEqual(left eliatrav1.ComponentStatus, right eliatrav1.ComponentStatus) bool
- func ComposePDB(cr *eliatrav1.OpenSearchCluster, nodepool *eliatrav1.NodePool) policyv1.PodDisruptionBudget
- func ContainsString(slice []string, s string) bool
- func CountPVCsForNodePool(k8sClient k8s.K8sClient, cr *eliatrav1.OpenSearchCluster, ...) (int, error)
- func CountRunningPodsForNodePool(k8sClient k8s.K8sClient, cr *eliatrav1.OpenSearchCluster, ...) (int, error)
- func DeleteDashboardsDeployment(k8sClient k8s.K8sClient, clusterName, clusterNamespace string) error
- func DeleteSTSForNodePool(k8sClient k8s.K8sClient, nodePool eliatrav1.NodePool, ...) error
- func DeleteSecurityUpdateJob(k8sClient k8s.K8sClient, clusterName, clusterNamespace string) error
- func DeleteStuckPodWithOlderRevision(k8sClient k8s.K8sClient, sts *appsv1.StatefulSet) error
- func DiffSlice(leftSlice, rightSlice []string) []string
- func FindByPath(obj interface{}, keys []string) (interface{}, bool)
- func FindFirstPartial(arr []eliatrav1.ComponentStatus, item eliatrav1.ComponentStatus, ...) (eliatrav1.ComponentStatus, bool)
- func GetByComponent(left eliatrav1.ComponentStatus, right eliatrav1.ComponentStatus) (eliatrav1.ComponentStatus, bool)
- func GetByDescriptionAndGroup(left eliatrav1.ComponentStatus, right eliatrav1.ComponentStatus) (eliatrav1.ComponentStatus, bool)
- func GetDashboardsDeployment(k8sClient k8s.K8sClient, clusterName, clusterNamespace string) (*appsv1.Deployment, error)
- func GetField(v *appsv1.StatefulSetSpec, field string) interface{}
- func GetPodWithOlderRevision(k8sClient k8s.K8sClient, sts *appsv1.StatefulSet) (*corev1.Pod, error)
- func GetSTSForNodePool(k8sClient k8s.K8sClient, nodePool eliatrav1.NodePool, ...) (*appsv1.StatefulSet, error)
- func HasDataRole(nodePool *eliatrav1.NodePool) bool
- func HasKeyWithBytes(data map[string][]byte, key string) bool
- func HasManagerRole(nodePool *eliatrav1.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 eliatrav1.ComponentStatus, ssSlice []eliatrav1.ComponentStatus) []eliatrav1.ComponentStatus
- func Replace(remove eliatrav1.ComponentStatus, add eliatrav1.ComponentStatus, ...) []eliatrav1.ComponentStatus
- func ReplicaHostName(currentSts appsv1.StatefulSet, repNum int32) string
- func ResolveClusterManagerRole(ver string) string
- func ResolveDashboardsImage(cr *eliatrav1.OpenSearchCluster) (result eliatrav1.ImageSpec)
- func ResolveImage(cr *eliatrav1.OpenSearchCluster, nodePool *eliatrav1.NodePool) (result eliatrav1.ImageSpec)
- func ResolveInitHelperImage(cr *eliatrav1.OpenSearchCluster) (result eliatrav1.ImageSpec)
- func SkipInitContainer() bool
- func SortedKeys(input map[string]string) []string
- func TranslateComponentTemplateToRequest(spec v1.OpensearchComponentTemplateSpec) requests.ComponentTemplate
- func TranslateIndexTemplateToRequest(spec v1.OpensearchIndexTemplateSpec) requests.IndexTemplate
- func TranslateIndexToRequest(spec v1.OpensearchIndexSpec) requests.Index
- func UpgradeInProgress(status eliatrav1.ClusterStatus) bool
- func UsernameAndPassword(k8sClient k8s.K8sClient, cr *eliatrav1.OpenSearchCluster) (string, string, error)
- func VersionCheck(instance *eliatrav1.OpenSearchCluster) (int32, int32, string)
- func WaitForSTSDelete(k8sClient k8s.K8sClient, obj *appsv1.StatefulSet) error
- func WaitForSTSReplicas(k8sClient k8s.K8sClient, obj *appsv1.StatefulSet, replicas int32) error
- func WaitForSTSStatus(k8sClient k8s.K8sClient, obj *appsv1.StatefulSet) (*appsv1.StatefulSet, error)
- func WorkingPodForRollingRestart(k8sClient k8s.K8sClient, sts *appsv1.StatefulSet) (string, 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 = "eliatra.io/opensearch-cluster" NodePoolLabel = "eliatra.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 ComponentStatusEqual ¶
func ComponentStatusEqual(left eliatrav1.ComponentStatus, right eliatrav1.ComponentStatus) bool
func ComposePDB ¶
func ComposePDB(cr *eliatrav1.OpenSearchCluster, nodepool *eliatrav1.NodePool) policyv1.PodDisruptionBudget
func ContainsString ¶
func CountPVCsForNodePool ¶
func CountPVCsForNodePool(k8sClient k8s.K8sClient, cr *eliatrav1.OpenSearchCluster, nodePool *eliatrav1.NodePool) (int, error)
Count the number of PVCs created for the given NodePool
func CountRunningPodsForNodePool ¶
func CountRunningPodsForNodePool(k8sClient k8s.K8sClient, cr *eliatrav1.OpenSearchCluster, nodePool *eliatrav1.NodePool) (int, error)
Count the number of pods running and ready and not terminating for a given nodePool
func DeleteDashboardsDeployment ¶
func DeleteDashboardsDeployment(k8sClient k8s.K8sClient, clusterName, clusterNamespace string) error
DeleteDashboardsDeployment deletes the OSD deployment along with all its pods
func DeleteSTSForNodePool ¶
func DeleteSTSForNodePool(k8sClient k8s.K8sClient, nodePool eliatrav1.NodePool, clusterName, clusterNamespace string) error
DeleteSTSForNodePool deletes the sts for the corresponding nodePool
func DeleteSecurityUpdateJob ¶
DeleteSecurityUpdateJob deletes the securityconfig update job
func DeleteStuckPodWithOlderRevision ¶
func DeleteStuckPodWithOlderRevision(k8sClient k8s.K8sClient, sts *appsv1.StatefulSet) error
DeleteStuckPodWithOlderRevision deletes the crashed pod only if there is any update in StatefulSet.
func FindByPath ¶
func FindFirstPartial ¶
func FindFirstPartial( arr []eliatrav1.ComponentStatus, item eliatrav1.ComponentStatus, predicator func(eliatrav1.ComponentStatus, eliatrav1.ComponentStatus) (eliatrav1.ComponentStatus, bool), ) (eliatrav1.ComponentStatus, bool)
func GetByComponent ¶
func GetByComponent(left eliatrav1.ComponentStatus, right eliatrav1.ComponentStatus) (eliatrav1.ComponentStatus, bool)
func GetByDescriptionAndGroup ¶
func GetByDescriptionAndGroup(left eliatrav1.ComponentStatus, right eliatrav1.ComponentStatus) (eliatrav1.ComponentStatus, bool)
func GetDashboardsDeployment ¶
func GetField ¶
func GetField(v *appsv1.StatefulSetSpec, field string) interface{}
func GetPodWithOlderRevision ¶
GetPodWithOlderRevision fetches the pod that is not having the updated revision.
func GetSTSForNodePool ¶
func GetSTSForNodePool(k8sClient k8s.K8sClient, nodePool eliatrav1.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 eliatrav1.ComponentStatus, ssSlice []eliatrav1.ComponentStatus) []eliatrav1.ComponentStatus
func Replace ¶
func Replace(remove eliatrav1.ComponentStatus, add eliatrav1.ComponentStatus, ssSlice []eliatrav1.ComponentStatus) []eliatrav1.ComponentStatus
func ReplicaHostName ¶
func ReplicaHostName(currentSts appsv1.StatefulSet, repNum int32) string
func ResolveDashboardsImage ¶
func ResolveDashboardsImage(cr *eliatrav1.OpenSearchCluster) (result eliatrav1.ImageSpec)
func ResolveImage ¶
func ResolveInitHelperImage ¶
func ResolveInitHelperImage(cr *eliatrav1.OpenSearchCluster) (result eliatrav1.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 TranslateComponentTemplateToRequest ¶
func TranslateComponentTemplateToRequest(spec v1.OpensearchComponentTemplateSpec) requests.ComponentTemplate
TranslateComponentTemplateToRequest rewrites the CRD format to the gateway format
func TranslateIndexTemplateToRequest ¶
func TranslateIndexTemplateToRequest(spec v1.OpensearchIndexTemplateSpec) requests.IndexTemplate
TranslateIndexTemplateToRequest rewrites the CRD format to the gateway format
func TranslateIndexToRequest ¶
func TranslateIndexToRequest(spec v1.OpensearchIndexSpec) requests.Index
TranslateIndexToRequest rewrites the CRD format to the gateway format
func UpgradeInProgress ¶
func UpgradeInProgress(status eliatrav1.ClusterStatus) bool
func UsernameAndPassword ¶
func VersionCheck ¶
func VersionCheck(instance *eliatrav1.OpenSearchCluster) (int32, int32, string)
Function to help identify httpPort, securityConfigPort and securityConfigPath for 1.x and 2.x OpenSearch Operator.
func WaitForSTSDelete ¶
func WaitForSTSDelete(k8sClient k8s.K8sClient, obj *appsv1.StatefulSet) error
Delete a STS with cascade=orphan and wait until it is actually deleted from the kubernetes API
func WaitForSTSReplicas ¶
Wait for max 30s until a STS has at least the given number of replicas
func WaitForSTSStatus ¶
func WaitForSTSStatus(k8sClient k8s.K8sClient, 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