@@ -549,7 +549,7 @@ func TestServiceAnnotations(t *testing.T) {
549549 operatorAnnotations : make (map [string ]string ),
550550 serviceAnnotations : make (map [string ]string ),
551551 expect : map [string ]string {
552- "external-dns.alpha.kubernetes.io/hostname" : "acid-test.test.db.example.com,test.acid.db.example.com" ,
552+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg .test.db.example.com,test-stg .acid.db.example.com" ,
553553 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
554554 },
555555 },
@@ -571,7 +571,7 @@ func TestServiceAnnotations(t *testing.T) {
571571 operatorAnnotations : make (map [string ]string ),
572572 serviceAnnotations : make (map [string ]string ),
573573 expect : map [string ]string {
574- "external-dns.alpha.kubernetes.io/hostname" : "acid-test.test.db.example.com,test.acid.db.example.com" ,
574+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg .test.db.example.com,test-stg .acid.db.example.com" ,
575575 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
576576 },
577577 },
@@ -583,7 +583,7 @@ func TestServiceAnnotations(t *testing.T) {
583583 operatorAnnotations : make (map [string ]string ),
584584 serviceAnnotations : map [string ]string {"foo" : "bar" },
585585 expect : map [string ]string {
586- "external-dns.alpha.kubernetes.io/hostname" : "acid-test.test.db.example.com,test.acid.db.example.com" ,
586+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg .test.db.example.com,test-stg .acid.db.example.com" ,
587587 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
588588 "foo" : "bar" ,
589589 },
@@ -606,7 +606,7 @@ func TestServiceAnnotations(t *testing.T) {
606606 operatorAnnotations : map [string ]string {"foo" : "bar" },
607607 serviceAnnotations : make (map [string ]string ),
608608 expect : map [string ]string {
609- "external-dns.alpha.kubernetes.io/hostname" : "acid-test.test.db.example.com,test.acid.db.example.com" ,
609+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg .test.db.example.com,test-stg .acid.db.example.com" ,
610610 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
611611 "foo" : "bar" ,
612612 },
@@ -621,7 +621,7 @@ func TestServiceAnnotations(t *testing.T) {
621621 },
622622 serviceAnnotations : make (map [string ]string ),
623623 expect : map [string ]string {
624- "external-dns.alpha.kubernetes.io/hostname" : "acid-test.test.db.example.com,test.acid.db.example.com" ,
624+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg .test.db.example.com,test-stg .acid.db.example.com" ,
625625 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
626626 },
627627 },
@@ -635,7 +635,7 @@ func TestServiceAnnotations(t *testing.T) {
635635 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
636636 },
637637 expect : map [string ]string {
638- "external-dns.alpha.kubernetes.io/hostname" : "acid-test.test.db.example.com,test.acid.db.example.com" ,
638+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg .test.db.example.com,test-stg .acid.db.example.com" ,
639639 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
640640 },
641641 },
@@ -649,7 +649,7 @@ func TestServiceAnnotations(t *testing.T) {
649649 "external-dns.alpha.kubernetes.io/hostname" : "wrong.external-dns-name.example.com" ,
650650 },
651651 expect : map [string ]string {
652- "external-dns.alpha.kubernetes.io/hostname" : "acid-test.test.db.example.com,test.acid.db.example.com" ,
652+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg .test.db.example.com,test-stg .acid.db.example.com" ,
653653 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
654654 },
655655 },
@@ -661,7 +661,7 @@ func TestServiceAnnotations(t *testing.T) {
661661 serviceAnnotations : make (map [string ]string ),
662662 operatorAnnotations : make (map [string ]string ),
663663 expect : map [string ]string {
664- "external-dns.alpha.kubernetes.io/hostname" : "acid-test.test.db.example.com,test.acid.db.example.com" ,
664+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg .test.db.example.com,test-stg .acid.db.example.com" ,
665665 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
666666 },
667667 },
@@ -679,7 +679,7 @@ func TestServiceAnnotations(t *testing.T) {
679679 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "2000" ,
680680 },
681681 expect : map [string ]string {
682- "external-dns.alpha.kubernetes.io/hostname" : "acid-test.test.db.example.com,test.acid.db.example.com" ,
682+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg .test.db.example.com,test-stg .acid.db.example.com" ,
683683 "service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" : "ip" ,
684684 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "2000" ,
685685 },
@@ -704,7 +704,7 @@ func TestServiceAnnotations(t *testing.T) {
704704 operatorAnnotations : make (map [string ]string ),
705705 serviceAnnotations : make (map [string ]string ),
706706 expect : map [string ]string {
707- "external-dns.alpha.kubernetes.io/hostname" : "acid-test-repl.test.db.example.com,test-repl.acid.db.example.com" ,
707+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg- repl.test.db.example.com,test-stg -repl.acid.db.example.com" ,
708708 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
709709 },
710710 },
@@ -726,7 +726,7 @@ func TestServiceAnnotations(t *testing.T) {
726726 operatorAnnotations : make (map [string ]string ),
727727 serviceAnnotations : make (map [string ]string ),
728728 expect : map [string ]string {
729- "external-dns.alpha.kubernetes.io/hostname" : "acid-test-repl.test.db.example.com,test-repl.acid.db.example.com" ,
729+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg- repl.test.db.example.com,test-stg -repl.acid.db.example.com" ,
730730 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
731731 },
732732 },
@@ -738,7 +738,7 @@ func TestServiceAnnotations(t *testing.T) {
738738 operatorAnnotations : make (map [string ]string ),
739739 serviceAnnotations : map [string ]string {"foo" : "bar" },
740740 expect : map [string ]string {
741- "external-dns.alpha.kubernetes.io/hostname" : "acid-test-repl.test.db.example.com,test-repl.acid.db.example.com" ,
741+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg- repl.test.db.example.com,test-stg -repl.acid.db.example.com" ,
742742 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
743743 "foo" : "bar" ,
744744 },
@@ -761,7 +761,7 @@ func TestServiceAnnotations(t *testing.T) {
761761 operatorAnnotations : map [string ]string {"foo" : "bar" },
762762 serviceAnnotations : make (map [string ]string ),
763763 expect : map [string ]string {
764- "external-dns.alpha.kubernetes.io/hostname" : "acid-test-repl.test.db.example.com,test-repl.acid.db.example.com" ,
764+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg- repl.test.db.example.com,test-stg -repl.acid.db.example.com" ,
765765 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
766766 "foo" : "bar" ,
767767 },
@@ -776,7 +776,7 @@ func TestServiceAnnotations(t *testing.T) {
776776 },
777777 serviceAnnotations : make (map [string ]string ),
778778 expect : map [string ]string {
779- "external-dns.alpha.kubernetes.io/hostname" : "acid-test-repl.test.db.example.com,test-repl.acid.db.example.com" ,
779+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg- repl.test.db.example.com,test-stg -repl.acid.db.example.com" ,
780780 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
781781 },
782782 },
@@ -790,7 +790,7 @@ func TestServiceAnnotations(t *testing.T) {
790790 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
791791 },
792792 expect : map [string ]string {
793- "external-dns.alpha.kubernetes.io/hostname" : "acid-test-repl.test.db.example.com,test-repl.acid.db.example.com" ,
793+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg- repl.test.db.example.com,test-stg -repl.acid.db.example.com" ,
794794 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
795795 },
796796 },
@@ -804,7 +804,7 @@ func TestServiceAnnotations(t *testing.T) {
804804 "external-dns.alpha.kubernetes.io/hostname" : "wrong.external-dns-name.example.com" ,
805805 },
806806 expect : map [string ]string {
807- "external-dns.alpha.kubernetes.io/hostname" : "acid-test-repl.test.db.example.com,test-repl.acid.db.example.com" ,
807+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg- repl.test.db.example.com,test-stg -repl.acid.db.example.com" ,
808808 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
809809 },
810810 },
@@ -816,7 +816,7 @@ func TestServiceAnnotations(t *testing.T) {
816816 serviceAnnotations : make (map [string ]string ),
817817 operatorAnnotations : make (map [string ]string ),
818818 expect : map [string ]string {
819- "external-dns.alpha.kubernetes.io/hostname" : "acid-test-repl.test.db.example.com,test-repl.acid.db.example.com" ,
819+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg- repl.test.db.example.com,test-stg -repl.acid.db.example.com" ,
820820 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
821821 },
822822 },
@@ -834,7 +834,7 @@ func TestServiceAnnotations(t *testing.T) {
834834 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "2000" ,
835835 },
836836 expect : map [string ]string {
837- "external-dns.alpha.kubernetes.io/hostname" : "acid-test-repl.test.db.example.com,test-repl.acid.db.example.com" ,
837+ "external-dns.alpha.kubernetes.io/hostname" : "acid-test-stg- repl.test.db.example.com,test-stg -repl.acid.db.example.com" ,
838838 "service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" : "ip" ,
839839 "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "2000" ,
840840 },
@@ -867,8 +867,10 @@ func TestServiceAnnotations(t *testing.T) {
867867 cl .OpConfig .CustomServiceAnnotations = tt .operatorAnnotations
868868 cl .OpConfig .EnableMasterLoadBalancer = tt .enableMasterLoadBalancerOC
869869 cl .OpConfig .EnableReplicaLoadBalancer = tt .enableReplicaLoadBalancerOC
870- cl .OpConfig .MasterDNSNameFormat = "{cluster}.{namespace}.{hostedzone}"
871- cl .OpConfig .ReplicaDNSNameFormat = "{cluster}-repl.{namespace}.{hostedzone}"
870+ cl .OpConfig .MasterDNSNameFormat = "{cluster}-stg.{namespace}.{hostedzone}"
871+ cl .OpConfig .MasterLegacyDNSNameFormat = "{cluster}-stg.{team}.{hostedzone}"
872+ cl .OpConfig .ReplicaDNSNameFormat = "{cluster}-stg-repl.{namespace}.{hostedzone}"
873+ cl .OpConfig .ReplicaLegacyDNSNameFormat = "{cluster}-stg-repl.{team}.{hostedzone}"
872874 cl .OpConfig .DbHostedZone = "db.example.com"
873875
874876 cl .Postgresql .Spec .ClusterName = ""
0 commit comments