@@ -118,7 +118,7 @@ func TestInstanceIsWritable(t *testing.T) {
118118 assert .Assert (t , ! writable )
119119
120120 // Patroni leader
121- instance .Pods [0 ].Annotations ["status" ] = `{"role":"master "}`
121+ instance .Pods [0 ].Annotations ["status" ] = `{"role":"primary "}`
122122 writable , known = instance .IsWritable ()
123123 assert .Assert (t , known )
124124 assert .Assert (t , writable )
@@ -393,7 +393,7 @@ func TestWritablePod(t *testing.T) {
393393 Namespace : "namespace" ,
394394 Name : "pod" ,
395395 Annotations : map [string ]string {
396- "status" : `{"role":"master "}` ,
396+ "status" : `{"role":"primary "}` ,
397397 },
398398 DeletionTimestamp : & metav1.Time {},
399399 },
@@ -427,7 +427,7 @@ func TestWritablePod(t *testing.T) {
427427 Namespace : "namespace" ,
428428 Name : "pod" ,
429429 Annotations : map [string ]string {
430- "status" : `{"role":"master "}` ,
430+ "status" : `{"role":"primary "}` ,
431431 },
432432 },
433433 Status : corev1.PodStatus {
@@ -492,7 +492,7 @@ func TestWritablePod(t *testing.T) {
492492 Namespace : "namespace" ,
493493 Name : "pod" ,
494494 Annotations : map [string ]string {
495- "status" : `{"role":"master "}` ,
495+ "status" : `{"role":"primary "}` ,
496496 },
497497 },
498498 Status : corev1.PodStatus {
@@ -965,13 +965,13 @@ func TestPodsToKeep(t *testing.T) {
965965 checks func (* testing.T , []corev1.Pod )
966966 }{
967967 {
968- name : "RemoveSetWithMasterOnly " ,
968+ name : "RemoveSetWithPrimaryOnly " ,
969969 instances : []corev1.Pod {
970970 {
971971 ObjectMeta : metav1.ObjectMeta {
972972 Name : "daisy-asdf" ,
973973 Labels : map [string ]string {
974- naming .LabelRole : "master " ,
974+ naming .LabelRole : "primary " ,
975975 naming .LabelInstanceSet : "daisy" ,
976976 },
977977 },
@@ -999,13 +999,13 @@ func TestPodsToKeep(t *testing.T) {
999999 assert .Equal (t , len (p ), 0 )
10001000 },
10011001 }, {
1002- name : "KeepMasterOnly " ,
1002+ name : "KeepPrimaryOnly " ,
10031003 instances : []corev1.Pod {
10041004 {
10051005 ObjectMeta : metav1.ObjectMeta {
10061006 Name : "daisy-asdf" ,
10071007 Labels : map [string ]string {
1008- naming .LabelRole : "master " ,
1008+ naming .LabelRole : "primary " ,
10091009 naming .LabelInstanceSet : "daisy" ,
10101010 },
10111011 },
@@ -1088,7 +1088,7 @@ func TestPodsToKeep(t *testing.T) {
10881088 assert .Equal (t , len (p ), 0 )
10891089 },
10901090 }, {
1091- name : "MasterLastInSet " ,
1091+ name : "PrimaryLastInSet " ,
10921092 instances : []corev1.Pod {
10931093 {
10941094 ObjectMeta : metav1.ObjectMeta {
@@ -1103,7 +1103,7 @@ func TestPodsToKeep(t *testing.T) {
11031103 ObjectMeta : metav1.ObjectMeta {
11041104 Name : "daisy-poih" ,
11051105 Labels : map [string ]string {
1106- naming .LabelRole : "master " ,
1106+ naming .LabelRole : "primary " ,
11071107 naming .LabelInstanceSet : "daisy" ,
11081108 },
11091109 },
@@ -1114,10 +1114,10 @@ func TestPodsToKeep(t *testing.T) {
11141114 },
11151115 checks : func (t * testing.T , p []corev1.Pod ) {
11161116 assert .Equal (t , len (p ), 1 )
1117- assert .Equal (t , p [0 ].Labels [naming .LabelRole ], "master " )
1117+ assert .Equal (t , p [0 ].Labels [naming .LabelRole ], "primary " )
11181118 },
11191119 }, {
1120- name : "ScaleDownSetWithMaster " ,
1120+ name : "ScaleDownSetWithPrimary " ,
11211121 instances : []corev1.Pod {
11221122 {
11231123 ObjectMeta : metav1.ObjectMeta {
@@ -1132,7 +1132,7 @@ func TestPodsToKeep(t *testing.T) {
11321132 ObjectMeta : metav1.ObjectMeta {
11331133 Name : "daisy-poih" ,
11341134 Labels : map [string ]string {
1135- naming .LabelRole : "master " ,
1135+ naming .LabelRole : "primary " ,
11361136 naming .LabelInstanceSet : "daisy" ,
11371137 },
11381138 },
@@ -1162,19 +1162,19 @@ func TestPodsToKeep(t *testing.T) {
11621162 },
11631163 checks : func (t * testing.T , p []corev1.Pod ) {
11641164 assert .Equal (t , len (p ), 2 )
1165- assert .Equal (t , p [0 ].Labels [naming .LabelRole ], "master " )
1165+ assert .Equal (t , p [0 ].Labels [naming .LabelRole ], "primary " )
11661166 assert .Equal (t , p [0 ].Labels [naming .LabelInstanceSet ], "daisy" )
11671167 assert .Equal (t , p [1 ].Labels [naming .LabelRole ], "replica" )
11681168 assert .Equal (t , p [1 ].Labels [naming .LabelInstanceSet ], "max" )
11691169 },
11701170 }, {
1171- name : "ScaleDownSetWithoutMaster " ,
1171+ name : "ScaleDownSetWithoutPrimary " ,
11721172 instances : []corev1.Pod {
11731173 {
11741174 ObjectMeta : metav1.ObjectMeta {
11751175 Name : "max-asdf" ,
11761176 Labels : map [string ]string {
1177- naming .LabelRole : "master " ,
1177+ naming .LabelRole : "primary " ,
11781178 naming .LabelInstanceSet : "max" ,
11791179 },
11801180 },
@@ -1213,21 +1213,21 @@ func TestPodsToKeep(t *testing.T) {
12131213 },
12141214 checks : func (t * testing.T , p []corev1.Pod ) {
12151215 assert .Equal (t , len (p ), 3 )
1216- assert .Equal (t , p [0 ].Labels [naming .LabelRole ], "master " )
1216+ assert .Equal (t , p [0 ].Labels [naming .LabelRole ], "primary " )
12171217 assert .Equal (t , p [0 ].Labels [naming .LabelInstanceSet ], "max" )
12181218 assert .Equal (t , p [1 ].Labels [naming .LabelInstanceSet ], "daisy" )
12191219 assert .Equal (t , p [1 ].Labels [naming .LabelRole ], "replica" )
12201220 assert .Equal (t , p [2 ].Labels [naming .LabelInstanceSet ], "daisy" )
12211221 assert .Equal (t , p [2 ].Labels [naming .LabelRole ], "replica" )
12221222 },
12231223 }, {
1224- name : "ScaleMasterSetToZero " ,
1224+ name : "ScalePrimarySetToZero " ,
12251225 instances : []corev1.Pod {
12261226 {
12271227 ObjectMeta : metav1.ObjectMeta {
12281228 Name : "max-asdf" ,
12291229 Labels : map [string ]string {
1230- naming .LabelRole : "master " ,
1230+ naming .LabelRole : "primary " ,
12311231 naming .LabelInstanceSet : "max" ,
12321232 },
12331233 },
@@ -1263,13 +1263,13 @@ func TestPodsToKeep(t *testing.T) {
12631263 assert .Equal (t , p [1 ].Labels [naming .LabelInstanceSet ], "daisy" )
12641264 },
12651265 }, {
1266- name : "RemoveMasterInstanceSet " ,
1266+ name : "RemovePrimaryInstanceSet " ,
12671267 instances : []corev1.Pod {
12681268 {
12691269 ObjectMeta : metav1.ObjectMeta {
12701270 Name : "max-asdf" ,
12711271 Labels : map [string ]string {
1272- naming .LabelRole : "master " ,
1272+ naming .LabelRole : "primary " ,
12731273 naming .LabelInstanceSet : "max" ,
12741274 },
12751275 },
@@ -1319,7 +1319,7 @@ func TestPodsToKeep(t *testing.T) {
13191319 t .Run (test .name , func (t * testing.T ) {
13201320 keep := podsToKeep (test .instances , test .want )
13211321 sort .Slice (keep , func (i , j int ) bool {
1322- return keep [i ].Labels [naming .LabelRole ] == "master "
1322+ return keep [i ].Labels [naming .LabelRole ] == "primary "
13231323 })
13241324 test .checks (t , keep )
13251325 })
0 commit comments