@@ -73,7 +73,7 @@ func fakePostgresCluster(clusterName, namespace, clusterUID string,
7373 },
7474 },
7575 }},
76- Backups : v1beta1.Backups {
76+ Backups : & v1beta1.Backups {
7777 PGBackRest : v1beta1.PGBackRestArchive {
7878 Image : "example.com/crunchy-pgbackrest:test" ,
7979 Jobs : & v1beta1.BackupJobs {
@@ -597,7 +597,7 @@ topologySpreadConstraints:
597597 ns := setupNamespace (t , tClient )
598598 // create a PostgresCluster without backups to test with
599599 postgresCluster := fakePostgresCluster (clusterName , ns .GetName (), clusterUID , true )
600- postgresCluster .Spec .Backups = v1beta1.Backups {}
600+ postgresCluster .Spec .Backups = & v1beta1.Backups {}
601601
602602 // create the 'observed' instances and set the leader
603603 instances := & observedInstances {
@@ -1489,7 +1489,7 @@ func TestGetPGBackRestResources(t *testing.T) {
14891489 UID : types .UID (clusterUID ),
14901490 },
14911491 Spec : v1beta1.PostgresClusterSpec {
1492- Backups : v1beta1.Backups {
1492+ Backups : & v1beta1.Backups {
14931493 PGBackRest : v1beta1.PGBackRestArchive {
14941494 Repos : []v1beta1.PGBackRestRepo {{Name : "repo1" }},
14951495 },
@@ -1526,7 +1526,7 @@ func TestGetPGBackRestResources(t *testing.T) {
15261526 UID : types .UID (clusterUID ),
15271527 },
15281528 Spec : v1beta1.PostgresClusterSpec {
1529- Backups : v1beta1.Backups {
1529+ Backups : & v1beta1.Backups {
15301530 PGBackRest : v1beta1.PGBackRestArchive {
15311531 Repos : []v1beta1.PGBackRestRepo {{Name : "repo4" }},
15321532 },
@@ -1562,7 +1562,7 @@ func TestGetPGBackRestResources(t *testing.T) {
15621562 UID : types .UID (clusterUID ),
15631563 },
15641564 Spec : v1beta1.PostgresClusterSpec {
1565- Backups : v1beta1.Backups {
1565+ Backups : & v1beta1.Backups {
15661566 PGBackRest : v1beta1.PGBackRestArchive {
15671567 Repos : []v1beta1.PGBackRestRepo {{
15681568 Name : "repo1" ,
@@ -1601,7 +1601,7 @@ func TestGetPGBackRestResources(t *testing.T) {
16011601 UID : types .UID (clusterUID ),
16021602 },
16031603 Spec : v1beta1.PostgresClusterSpec {
1604- Backups : v1beta1.Backups {
1604+ Backups : & v1beta1.Backups {
16051605 PGBackRest : v1beta1.PGBackRestArchive {
16061606 Repos : []v1beta1.PGBackRestRepo {{
16071607 Name : "repo4" ,
@@ -1642,7 +1642,7 @@ func TestGetPGBackRestResources(t *testing.T) {
16421642 UID : types .UID (clusterUID ),
16431643 },
16441644 Spec : v1beta1.PostgresClusterSpec {
1645- Backups : v1beta1.Backups {
1645+ Backups : & v1beta1.Backups {
16461646 PGBackRest : v1beta1.PGBackRestArchive {
16471647 Repos : []v1beta1.PGBackRestRepo {{Volume : & v1beta1.RepoPVC {}}},
16481648 },
@@ -1680,7 +1680,7 @@ func TestGetPGBackRestResources(t *testing.T) {
16801680 UID : types .UID (clusterUID ),
16811681 },
16821682 Spec : v1beta1.PostgresClusterSpec {
1683- Backups : v1beta1.Backups {
1683+ Backups : & v1beta1.Backups {
16841684 PGBackRest : v1beta1.PGBackRestArchive {},
16851685 },
16861686 },
@@ -2233,7 +2233,7 @@ func TestCopyConfigurationResources(t *testing.T) {
22332233 },
22342234 },
22352235 }},
2236- Backups : v1beta1.Backups {
2236+ Backups : & v1beta1.Backups {
22372237 PGBackRest : v1beta1.PGBackRestArchive {
22382238 Configuration : []corev1.VolumeProjection {{
22392239 Secret : & corev1.SecretProjection {
@@ -2285,7 +2285,7 @@ func TestCopyConfigurationResources(t *testing.T) {
22852285 },
22862286 },
22872287 }},
2288- Backups : v1beta1.Backups {
2288+ Backups : & v1beta1.Backups {
22892289 PGBackRest : v1beta1.PGBackRestArchive {
22902290 Image : "example.com/crunchy-pgbackrest:test" ,
22912291 Repos : []v1beta1.PGBackRestRepo {{
@@ -2518,7 +2518,7 @@ volumes:
25182518 cluster := & v1beta1.PostgresCluster {}
25192519
25202520 t .Run ("Resources not defined in jobs" , func (t * testing.T ) {
2521- cluster .Spec .Backups = v1beta1.Backups {
2521+ cluster .Spec .Backups = & v1beta1.Backups {
25222522 PGBackRest : v1beta1.PGBackRestArchive {},
25232523 }
25242524 job := generateBackupJobSpecIntent (ctx ,
@@ -2568,7 +2568,7 @@ volumes:
25682568
25692569 cluster := & v1beta1.PostgresCluster {
25702570 Spec : v1beta1.PostgresClusterSpec {
2571- Backups : v1beta1.Backups {
2571+ Backups : & v1beta1.Backups {
25722572 PGBackRest : v1beta1.PGBackRestArchive {
25732573 Jobs : & v1beta1.BackupJobs {
25742574 Affinity : affinity ,
@@ -2775,7 +2775,7 @@ func TestGenerateRestoreJobIntent(t *testing.T) {
27752775 Labels : map [string ]string {"Global" : "test" },
27762776 Annotations : map [string ]string {"Global" : "test" },
27772777 },
2778- Backups : v1beta1.Backups {PGBackRest : v1beta1.PGBackRestArchive {
2778+ Backups : & v1beta1.Backups {PGBackRest : v1beta1.PGBackRestArchive {
27792779 Metadata : & v1beta1.Metadata {
27802780 Labels : map [string ]string {"Backrest" : "test" },
27812781 Annotations : map [string ]string {"Backrest" : "test" },
@@ -3786,7 +3786,7 @@ func TestBackupsEnabled(t *testing.T) {
37863786 ns := setupNamespace (t , tClient )
37873787
37883788 postgresCluster := fakePostgresCluster (clusterName , ns .GetName (), clusterUID , true )
3789- postgresCluster .Spec .Backups = v1beta1.Backups {}
3789+ postgresCluster .Spec .Backups = & v1beta1.Backups {}
37903790
37913791 backupsSpecFound , backupsReconciliationAllowed , err := r .BackupsEnabled (ctx , postgresCluster )
37923792
@@ -3822,7 +3822,7 @@ func TestBackupsEnabled(t *testing.T) {
38223822 _ , err = r .reconcilePGBackRest (ctx , postgresCluster , instances , rootCA , true )
38233823 assert .NilError (t , err )
38243824
3825- postgresCluster .Spec .Backups = v1beta1.Backups {}
3825+ postgresCluster .Spec .Backups = & v1beta1.Backups {}
38263826
38273827 backupsSpecFound , backupsReconciliationAllowed , err := r .BackupsEnabled (ctx , postgresCluster )
38283828
@@ -3858,7 +3858,7 @@ func TestBackupsEnabled(t *testing.T) {
38583858 _ , err = r .reconcilePGBackRest (ctx , postgresCluster , instances , rootCA , true )
38593859 assert .NilError (t , err )
38603860
3861- postgresCluster .Spec .Backups = v1beta1.Backups {}
3861+ postgresCluster .Spec .Backups = & v1beta1.Backups {}
38623862 annotations := map [string ]string {
38633863 naming .AuthorizeBackupRemovalAnnotation : "true" ,
38643864 }
0 commit comments