@@ -512,6 +512,31 @@ spec:
512512 Expect (icm .Data ["patroni.yaml" ]).ToNot (BeZero ())
513513 })
514514
515+ It ("doesn't reconcile ConfigMap with override annotation" , func () {
516+ icm := & corev1.ConfigMap {}
517+ Expect (suite .Client .Get (context .Background (), client.ObjectKey {
518+ Namespace : test .Namespace .Name , Name : instance .Name + "-config" ,
519+ }, icm )).To (Succeed ())
520+
521+ Expect (icm .Labels [naming .LabelCluster ]).To (Equal ("carlos" ))
522+ Expect (icm .Labels [naming .LabelInstance ]).To (Equal (instance .Name ))
523+ Expect (icm .Data ["patroni.yaml" ]).ToNot (BeZero ())
524+
525+ icm .SetAnnotations (map [string ]string {
526+ naming .OverrideConfigAnnotation : "true" ,
527+ })
528+ icm .Data ["patroni.yaml" ] = ""
529+
530+ Expect (suite .Client .Update (context .Background (), icm )).To (Succeed ())
531+
532+ Expect (suite .Client .Get (context .Background (), client.ObjectKey {
533+ Namespace : test .Namespace .Name , Name : instance .Name + "-config" ,
534+ }, icm )).To (Succeed ())
535+
536+ Expect (icm .Annotations [naming .OverrideConfigAnnotation ]).To (Equal ("true" ))
537+ Expect (icm .Data ["patroni.yaml" ]).To (BeZero ())
538+ })
539+
515540 Specify ("Instance StatefulSet" , func () {
516541 Expect (instance .Labels [naming .LabelCluster ]).To (Equal ("carlos" ))
517542 Expect (instance .Labels [naming .LabelInstanceSet ]).To (Equal ("samba" ))
0 commit comments