Skip to content

Commit

Permalink
[BACKPORT 2.18.4][PLAT-11075] Allowing exclusion of releases/promethe…
Browse files Browse the repository at this point in the history
…us in YBA-installer backups

Summary:
Fixes for backups in YBA-installer that allowed exclusion of prometheus and releases went into
2.18.3 and were missed for 2.18.4.0. We might as well also get them into 2.18.4.1.

Test Plan: check generated yba-ctl binary for exclude flags

Reviewers: dshubin, sanketh

Reviewed By: dshubin

Subscribers: yugaware

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D29829
  • Loading branch information
mchiddy committed Nov 3, 2023
1 parent a39a0df commit ec8422d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions managed/yba-installer/cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

// CreateBackupScript calls the yb_platform_backup.sh script with the correct args.
func CreateBackupScript(outputPath string, dataDir string,
excludePrometheus bool, skipRestart bool, verbose bool, plat Platform) {
excludePrometheus bool, excludeReleases bool, skipRestart bool, verbose bool, plat Platform) {

fileName := plat.backupScript()
err := os.Chmod(fileName, 0777)
Expand All @@ -34,7 +34,10 @@ func CreateBackupScript(outputPath string, dataDir string,
args := []string{"create", "--output", outputPath, "--data_dir", dataDir,
"--yba_installer"}
if excludePrometheus {
args = append(args, "--exclude-prometheus")
args = append(args, "--exclude_prometheus")
}
if excludeReleases {
args = append(args, "--exclude_releases")
}
if skipRestart {
args = append(args, "--skip_restart")
Expand Down Expand Up @@ -151,6 +154,7 @@ func createPgPass() {
func createBackupCmd() *cobra.Command {
var dataDir string
var excludePrometheus bool
var excludeReleases bool
var skipRestart bool
var verbose bool

Expand Down Expand Up @@ -180,7 +184,8 @@ func createBackupCmd() *cobra.Command {

outputPath := args[0]
if plat, ok := services["yb-platform"].(Platform); ok {
CreateBackupScript(outputPath, dataDir, excludePrometheus, skipRestart, verbose, plat)
CreateBackupScript(outputPath, dataDir, excludePrometheus, excludeReleases, skipRestart,
verbose, plat)
} else {
log.Fatal("Could not cast service to Platform struct.")
}
Expand All @@ -191,6 +196,8 @@ func createBackupCmd() *cobra.Command {
"data directory to be backed up")
createBackup.Flags().BoolVar(&excludePrometheus, "exclude_prometheus", false,
"exclude prometheus metric data from backup (default: false)")
createBackup.Flags().BoolVar(&excludeReleases, "exclude_releases", false,
"exclude prometheus metric data from backup (default: false)")
createBackup.Flags().BoolVar(&skipRestart, "skip_restart", false,
"don't restart processes during execution (default: false)")
createBackup.Flags().BoolVar(&verbose, "verbose", false,
Expand Down

0 comments on commit ec8422d

Please sign in to comment.