Skip to content

Commit c29b0a1

Browse files
committed
add test case
1 parent 8a6ff45 commit c29b0a1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Diff for: internal/patroni/config_test.go

+26
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,32 @@ postgresql:
976976
pgpass: /tmp/.pgpass
977977
use_unix_socket: true
978978
restapi: {}
979+
tags: {}
980+
`, "\t\n")+"\n")
981+
982+
cluster.Spec.Patroni.CreateReplicaMethods = []v1beta1.CreateReplicaMethod{"basebackup", "pgbackrest"}
983+
dataWithCustomMethods, err := instanceYAML(cluster, instance, nil)
984+
assert.NilError(t, err)
985+
assert.Equal(t, dataWithCustomMethods, strings.Trim(`
986+
# Generated by postgres-operator. DO NOT EDIT.
987+
# Your changes will not be saved.
988+
bootstrap:
989+
initdb:
990+
- data-checksums
991+
- encoding=UTF8
992+
- waldir=/pgdata/pg12_wal
993+
- encryption-key-command=echo test
994+
method: initdb
995+
kubernetes: {}
996+
postgresql:
997+
basebackup:
998+
- waldir=/pgdata/pg12_wal
999+
create_replica_methods:
1000+
- basebackup
1001+
- pgbackrest
1002+
pgpass: /tmp/.pgpass
1003+
use_unix_socket: true
1004+
restapi: {}
9791005
tags: {}
9801006
`, "\t\n")+"\n")
9811007
}

0 commit comments

Comments
 (0)