INNER CODE UNIT · Go

getK8sClient

mariadb-operator/mariadb-operator · cmd/backup/main.go:343

func getK8sClient() (client.Client, error) {
	restConfig, err := ctrl.GetConfig()
	if err != nil {
		return nil, fmt.Errorf("error getting REST config: %v", err)
	}
	k8sClient, err := client.New(restConfig, client.Options{Scheme: scheme})
	if err != nil {
		return nil, fmt.Errorf("error creating Kubernetes client: %v", err)
	}
	return k8sClient, nil
}

func getBackupGTID() (string, error) {
	metaFilePath := filepath.Join(physicalBackupDirPath, replication.MariaDBOperatorFileName)
	bytes, err := os.ReadFile(metaFilePath)
	if err != nil {
		return "", fmt.Errorf("error reading backup meta file %s: %v", metaFilePath, err)
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…