@@ -7,6 +7,7 @@ package postgrescluster
77import (
88 "context"
99 "testing"
10+ "time"
1011
1112 "github.com/pkg/errors"
1213 "gotest.tools/v3/assert"
@@ -561,7 +562,7 @@ func TestReconcileDedicatedSnapshotVolume(t *testing.T) {
561562 // Create successful restore job
562563 restoreJob := testRestoreJob (cluster )
563564 restoreJob .Annotations = map [string ]string {
564- naming .PGBackRestBackupJobCompletion : backupJob .Status .CompletionTime .String ( ),
565+ naming .PGBackRestBackupJobCompletion : backupJob .Status .CompletionTime .Format ( time . RFC3339 ),
565566 }
566567 err = errors .WithStack (r .setControllerReference (cluster , restoreJob ))
567568 assert .NilError (t , err )
@@ -603,7 +604,7 @@ func TestReconcileDedicatedSnapshotVolume(t *testing.T) {
603604 assert .Equal (t , len (restoreJobs .Items ), 0 )
604605
605606 // Assert pvc was annotated
606- assert .Equal (t , pvc .GetAnnotations ()[naming .PGBackRestBackupJobCompletion ], backupJob .Status .CompletionTime .String ( ))
607+ assert .Equal (t , pvc .GetAnnotations ()[naming .PGBackRestBackupJobCompletion ], backupJob .Status .CompletionTime .Format ( time . RFC3339 ))
607608 })
608609
609610 t .Run ("SnapshotsEnabledFailedRestoreExists" , func (t * testing.T ) {
@@ -646,7 +647,7 @@ func TestReconcileDedicatedSnapshotVolume(t *testing.T) {
646647 // Create failed restore job
647648 restoreJob := testRestoreJob (cluster )
648649 restoreJob .Annotations = map [string ]string {
649- naming .PGBackRestBackupJobCompletion : backupJob .Status .CompletionTime .String ( ),
650+ naming .PGBackRestBackupJobCompletion : backupJob .Status .CompletionTime .Format ( time . RFC3339 ),
650651 }
651652 err = errors .WithStack (r .setControllerReference (cluster , restoreJob ))
652653 assert .NilError (t , err )
@@ -758,7 +759,7 @@ func TestDedicatedSnapshotVolumeRestore(t *testing.T) {
758759 assert .NilError (t , err )
759760 assert .Equal (t , len (jobs .Items ), 1 )
760761 assert .Equal (t , jobs .Items [0 ].Annotations [naming .PGBackRestBackupJobCompletion ],
761- backupJob .Status .CompletionTime .String ( ))
762+ backupJob .Status .CompletionTime .Format ( time . RFC3339 ))
762763}
763764
764765func TestGenerateSnapshotOfDedicatedSnapshotVolume (t * testing.T ) {
0 commit comments