Skip to content

Commit

Permalink
Fix Panic on pause and resume cli (#779)
Browse files Browse the repository at this point in the history
Signed-off-by: souravbiswassanto <[email protected]>
  • Loading branch information
souravbiswassanto authored Oct 15, 2024
1 parent 6d82a89 commit 1fa678d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/pauser/mariadb.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (e *MariaDBPauser) Pause(name, namespace string) (bool, error) {
}

pauseAll := !(e.onlyBackup || e.onlyDb || e.onlyArchiver)
if e.onlyArchiver || pauseAll {
if (e.onlyArchiver || pauseAll) && db.Spec.Archiver != nil {
if err := PauseOrResumeMariaDBArchiver(e.kc, true, db.Spec.Archiver.Ref); err != nil {
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/pauser/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (e *MongoDBPauser) Pause(name, namespace string) (bool, error) {
}

pauseAll := !(e.onlyBackup || e.onlyDb || e.onlyArchiver)
if e.onlyArchiver || pauseAll {
if (e.onlyArchiver || pauseAll) && db.Spec.Archiver != nil {
if err := PauseOrResumeMongoDBArchiver(e.kc, true, db.Spec.Archiver.Ref); err != nil {
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/pauser/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (e *MySQLPauser) Pause(name string, namespace string) (bool, error) {
return false, nil
}
pauseAll := !(e.onlyBackup || e.onlyDb || e.onlyArchiver)
if e.onlyArchiver || pauseAll {
if (e.onlyArchiver || pauseAll) && db.Spec.Archiver != nil {
if err := PauseOrResumeMySQLArchiver(e.kc, true, db.Spec.Archiver.Ref); err != nil {
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/pauser/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (e *PostgresPauser) Pause(name, namespace string) (bool, error) {

pauseAll := !(e.onlyBackup || e.onlyDb || e.onlyArchiver)

if e.onlyArchiver || pauseAll {
if (e.onlyArchiver || pauseAll) && db.Spec.Archiver != nil {
if err := PauseOrResumePostgresArchiver(e.kc, true, db.Spec.Archiver.Ref); err != nil {
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resumer/mariadb.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (e *MariaDBResumer) Resume(name, namespace string) (bool, error) {

resumeAll := !(e.onlyBackup || e.onlyDb || e.onlyArchiver)

if e.onlyArchiver || resumeAll {
if (e.onlyArchiver || resumeAll) && db.Spec.Archiver != nil {
if err := pautil.PauseOrResumeMariaDBArchiver(e.kc, false, db.Spec.Archiver.Ref); err != nil {
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resumer/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (e *MongoDBResumer) Resume(name, namespace string) (bool, error) {
}
resumeAll := !(e.onlyBackup || e.onlyDb || e.onlyArchiver)

if e.onlyArchiver || resumeAll {
if (e.onlyArchiver || resumeAll) && db.Spec.Archiver != nil {
if err := pautil.PauseOrResumeMongoDBArchiver(e.kc, false, db.Spec.Archiver.Ref); err != nil {
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resumer/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (e *MySQLResumer) Resume(name, namespace string) (bool, error) {

resumeAll := !(e.onlyBackup || e.onlyDb || e.onlyArchiver)

if e.onlyArchiver || resumeAll {
if (e.onlyArchiver || resumeAll) && db.Spec.Archiver != nil {
if err := pautil.PauseOrResumeMySQLArchiver(e.kc, false, db.Spec.Archiver.Ref); err != nil {
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resumer/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (e *PostgresResumer) Resume(name, namespace string) (bool, error) {
}
resumeAll := !(e.onlyBackup || e.onlyDb || e.onlyArchiver)

if e.onlyArchiver || resumeAll {
if (e.onlyArchiver || resumeAll) && db.Spec.Archiver != nil {
if err := pautil.PauseOrResumePostgresArchiver(e.kc, false, db.Spec.Archiver.Ref); err != nil {
return false, err
}
Expand Down

0 comments on commit 1fa678d

Please sign in to comment.