INNER CODE UNIT · Go

init

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

func init() {
	utilruntime.Must(mariadbv1alpha1.AddToScheme(scheme))

	RootCmd.PersistentFlags().StringVar(&path, "path", "/backup", "Directory path where the backup files are located."+
		"When S3 is enabled, it is used as staging area and the source of truth of backups remains in S3.")
	RootCmd.PersistentFlags().StringVar(&targetFilePath, "target-file-path", "/backup/0-backup-target.txt",
		"Path to a file that contains the name of the backup target file.")
	if err := RootCmd.MarkPersistentFlagRequired("path"); err != nil {
		fmt.Printf("error marking 'path' flag as required: %v", err)
		os.Exit(1)
	}
	if err := RootCmd.MarkPersistentFlagRequired("target-file-path"); err != nil {
		fmt.Printf("error marking 'target-file-path' flag as required: %v", err)
		os.Exit(1)
	}
	RootCmd.PersistentFlags().StringVar(&backupContentType, "backup-content-type", string(mariadbv1alpha1.BackupContentTypeLogical),
		"Backup type: Logical (mariadb-dump) or Physical (mariadb-backup).")
	RootCmd.PersistentFlags().BoolVar(&cleanupTargetFile, "cleanup-target-file", false,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…