commons

package
v0.0.0-...-a834cfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2024 License: UPL-1.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShardingDatabaseFinalizer = "Shardingdb.oracle.com"
	TmpLoc                    = "/var/tmp"
)

Constants for hello-stateful StatefulSet & Volumes

Variables

This section is empty.

Functions

func AddNamespace

func AddNamespace(instance *databasealphav1.ShardingDatabase, kClient client.Client, logger logr.Logger,
) error

func AddShardInGsm

func AddShardInGsm(gsmPodName string, sparams string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

Function to verify the chunks

func BuildServiceDefForCatalog

func BuildServiceDefForCatalog(instance *databasev1alpha1.ShardingDatabase, replicaCount int32, OraCatalogSpex databasev1alpha1.CatalogSpec, svctype string) *corev1.Service

func BuildServiceDefForGsm

func BuildServiceDefForGsm(instance *databasev1alpha1.ShardingDatabase, replicaCount int32, OraGsmSpex databasev1alpha1.GsmSpec, svctype string) *corev1.Service

func BuildServiceDefForShard

func BuildServiceDefForShard(instance *databasev1alpha1.ShardingDatabase, replicaCount int32, OraShardSpex databasev1alpha1.ShardSpec, svctype string) *corev1.Service

func BuildShardParams

func BuildShardParams(instance *databasealphav1.ShardingDatabase, sfSet *appsv1.StatefulSet, OraShardSpex databasev1alpha1.ShardSpec) string

func BuildStatefulSetForCatalog

func BuildStatefulSetForCatalog(instance *databasev1alpha1.ShardingDatabase, OraCatalogSpex databasev1alpha1.CatalogSpec) *appsv1.StatefulSet

func BuildStatefulSetForGsm

func BuildStatefulSetForGsm(instance *databasev1alpha1.ShardingDatabase, OraGsmSpex databasev1alpha1.GsmSpec) *appsv1.StatefulSet

func BuildStatefulSetForShard

func BuildStatefulSetForShard(instance *databasev1alpha1.ShardingDatabase, OraShardSpex databasev1alpha1.ShardSpec) *appsv1.StatefulSet

func CancelChunksInGsm

func CancelChunksInGsm(gsmPodName string, sparams string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

Function to verify the chunks

func CheckGsmStatus

func CheckGsmStatus(gname string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

======================= CHeck GSM Director Status ==============

func CheckGsmStatusInst

func CheckGsmStatusInst(instSpex []databasealphav1.GsmStatusDetails, name string,
) (int, bool)

CHeck if record exist in a struct

func CheckIsDeleteFlag

func CheckIsDeleteFlag(delStr string, instance *databasealphav1.ShardingDatabase, logger logr.Logger) bool

func CheckOnlineShardInGsm

func CheckOnlineShardInGsm(gsmPodName string, sparams string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

Function to check the online Shard

func CheckSfset

func CheckSfset(sfsetName string, instance *databasealphav1.ShardingDatabase, kClient client.Client) (*appsv1.StatefulSet, error)

func CheckShardInGsm

func CheckShardInGsm(gsmPodName string, sparams string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

Function to check shadrd in GSM

func CheckSvc

func CheckSvc(svcName string, instance *databasealphav1.ShardingDatabase, kClient client.Client) (*corev1.Service, error)

func Contains

func Contains(list []string, s string) bool

func DelPvc

func DelPvc(pvcName string, instance *databasealphav1.ShardingDatabase, kClient client.Client, logger logr.Logger) error

func DelSvc

func DelSvc(pvcName string, instance *databasealphav1.ShardingDatabase, kClient client.Client, logger logr.Logger) error

func DeployShardInGsm

func DeployShardInGsm(gsmPodName string, sparams string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

Function to deploy the Shards

func ExecCommand

func ExecCommand(podName string, cmd []string, kubeClient kubernetes.Interface, kubeConfig clientcmd.ClientConfig, instance *databasealphav1.ShardingDatabase, logger logr.Logger) (string, string, error)

ExecCMDInContainer execute command in first container of a pod

func GetDbOpenMode

func GetDbOpenMode(PodName string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) string

func GetDbRole

func GetDbRole(PodName string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) string

func GetFmtStr

func GetFmtStr(pstr string,
) string

func GetGsmCatalogStatusKey

func GetGsmCatalogStatusKey(instance *databasealphav1.ShardingDatabase, key string) string

func GetGsmDetailsSttausKey

func GetGsmDetailsSttausKey(instance *databasealphav1.ShardingDatabase, key string) string

func GetGsmPodName

func GetGsmPodName(gsmName string) string

func GetGsmServices

func GetGsmServices(PodName string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) string

func GetGsmShardStatus

func GetGsmShardStatus(instance *databasealphav1.ShardingDatabase, name string) string

func GetGsmShardStatusKey

func GetGsmShardStatusKey(instance *databasealphav1.ShardingDatabase, key string) string

func GetIpCmd

func GetIpCmd(svcName string) []string

func GetK8sClientConfig

func GetK8sClientConfig(kClient client.Client) (clientcmd.ClientConfig, kubernetes.Interface, error)

func GetMetaCondition

func GetMetaCondition(instance *databasealphav1.ShardingDatabase, result *ctrl.Result, err *error, stateType string, stateMsg string) metav1.Condition

File the meta condition and return the meta view

func GetPdbName

func GetPdbName(variables []databasealphav1.EnvironmentVariable, name string) string

func GetPodCopyConfig

func GetPodCopyConfig(kubeClient kubernetes.Interface, kubeConfig clientcmd.ClientConfig, instance *databasealphav1.ShardingDatabase, logger logr.Logger) (*rest.Config, *kubernetes.Clientset, error)

func GetPodList

func GetPodList(sfsetName string, resType string, instance *databasealphav1.ShardingDatabase, kClient client.Client,
) (*corev1.PodList, error)

func GetSecretMount

func GetSecretMount() string

func GetShardInviteNodeCmd

func GetShardInviteNodeCmd(shardName string) []string

func GetSidName

func GetSidName(variables []databasealphav1.EnvironmentVariable, name string) string

func GetSvcIp

func GetSvcIp(PodName string, sparams string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) (string, string, error)

func GetTdeKeyLocCmd

func GetTdeKeyLocCmd() []string

func InstanceShardPatch

func InstanceShardPatch(obj client.Object, instance *databasealphav1.ShardingDatabase, kClient client.Client, id int32, field string, value string,
) error

func KctlCopyFile

func KctlCopyFile(kubeClient kubernetes.Interface, kubeConfig clientcmd.ClientConfig, instance *databasealphav1.ShardingDatabase, restConfig *rest.Config, kclientset *kubernetes.Clientset, logger logr.Logger, src string, dst string, containername string) (*bytes.Buffer, *bytes.Buffer, *bytes.Buffer, error)

func LabelsForProvShardKind

func LabelsForProvShardKind(instance *databasealphav1.ShardingDatabase, sftype string,
) map[string]string

func LogMessages

func LogMessages(msgtype string, msg string, err error, instance *databasealphav1.ShardingDatabase, logger logr.Logger)

func MoveChunks

func MoveChunks(gsmPodName string, sparams string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

Function to move the chunks

func NewNamespace

func NewNamespace(name string) *corev1.Namespace

NewNamespace creates a corev1.Namespace object using the provided name.

func OraCleanupForGsm

func OraCleanupForGsm(instance *databasev1alpha1.ShardingDatabase,
	OraGsmSpex databasev1alpha1.GsmSpec,
	oldReplicaSize int32,
	newReplicaSize int32,
) string

This function cleanup the shard from GSM

func PodListValidation

func PodListValidation(podList *corev1.PodList, sfName string, instance *databasealphav1.ShardingDatabase, kClient client.Client,
) (bool, *corev1.Pod)

func ReadConfigMap

func ReadConfigMap(cmName string, instance *databasealphav1.ShardingDatabase, kClient client.Client, logger logr.Logger,
) (string, string, string, string, string, string)

func ReadSecret

func ReadSecret(secName string, instance *databasealphav1.ShardingDatabase, kClient client.Client, logger logr.Logger,
) string

func RemoveShardFromGsm

func RemoveShardFromGsm(gsmPodName string, sparams string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

Function to delete the shard

func SendNotification

func SendNotification(title string, body string, instance *databasealphav1.ShardingDatabase, topicId string, rclient ons.NotificationDataPlaneClient, logger logr.Logger,
)

func SfsetLabelPatch

func SfsetLabelPatch(sfSetFound *appsv1.StatefulSet, sfSetPod *corev1.Pod, instance *databasealphav1.ShardingDatabase, kClient client.Client,
) error

func UpdateCatalogStatusData

func UpdateCatalogStatusData(instance *databasealphav1.ShardingDatabase, Specidx int, state string, kubeClient kubernetes.Interface, kubeConfig clientcmd.ClientConfig, logger logr.Logger,
)

func UpdateGsmShardStatus

func UpdateGsmShardStatus(instance *databasealphav1.ShardingDatabase, name string, state string)

func UpdateGsmStatusData

func UpdateGsmStatusData(instance *databasealphav1.ShardingDatabase, Specidx int, state string, kubeClient kubernetes.Interface, kubeConfig clientcmd.ClientConfig, logger logr.Logger,
)

func UpdateProvForCatalog

func UpdateProvForCatalog(instance *databasev1alpha1.ShardingDatabase,
	OraCatalogSpex databasev1alpha1.CatalogSpec, kClient client.Client, sfSet *appsv1.StatefulSet, catalogPod *corev1.Pod, logger logr.Logger,
) (ctrl.Result, error)

======================== update Section ========================

func UpdateProvForGsm

func UpdateProvForGsm(instance *databasev1alpha1.ShardingDatabase,
	OraGsmSpex databasev1alpha1.GsmSpec, kClient client.Client, sfSet *appsv1.StatefulSet, gsmPod *corev1.Pod, logger logr.Logger,
) (ctrl.Result, error)

func UpdateProvForShard

func UpdateProvForShard(instance *databasev1alpha1.ShardingDatabase, OraShardSpex databasev1alpha1.ShardSpec, kClient client.Client, sfSet *appsv1.StatefulSet, shardPod *corev1.Pod, logger logr.Logger,
) (ctrl.Result, error)

======================== Update Section ========================

func UpdateShardStatusData

func UpdateShardStatusData(instance *databasealphav1.ShardingDatabase, Specidx int, state string, kubeClient kubernetes.Interface, kubeConfig clientcmd.ClientConfig, logger logr.Logger,
)

func ValidateDbSetup

func ValidateDbSetup(podName string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

============ Functiont o check the status of the Shard and catalog ========= ================================ Validate shard ===========================

func VerifyChunks

func VerifyChunks(gsmPodName string, sparams string, instance *databasealphav1.ShardingDatabase, kubeClient kubernetes.Interface, kubeconfig clientcmd.ClientConfig, logger logr.Logger,
) error

Function to verify the chunks

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL