Skip to content

Commit

Permalink
[BACKPORT 2.20][PLAT-15282]: fix NPE on k8s operator backup/restore s…
Browse files Browse the repository at this point in the history
…tatus update

Summary:
If any failed backup/restore exists in k8s operator resource, then status update for other b/r restore is failed with NPE as old failed resource does not have status.

Original diff/commit: 56c9cc9/D38125

Test Plan: Tested manually by creating failed backup which does not have status and veridfied the issue but after this change, b/r status were updated correctly as failed one are skipped.

Reviewers: anijhawan, vkumar

Reviewed By: vkumar

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D38168
  • Loading branch information
vipul-yb committed Sep 20, 2024
1 parent b7f4056 commit 8d4f15a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public void updateBackupStatus(

for (Backup backupCr :
kubernetesClient.resources(Backup.class).inNamespace(namespace).list().getItems()) {
if (backupCr.getStatus().getTaskUUID().equals(taskUUID.toString())) {
if (backupCr.getStatus() != null
&& backupCr.getStatus().getTaskUUID().equals(taskUUID.toString())) {
// Found our backup.
log.info("Found Backup {} task {} ", backupCr, taskUUID);
BackupStatus status = backupCr.getStatus();
Expand Down

0 comments on commit 8d4f15a

Please sign in to comment.