@@ -549,7 +549,7 @@ func TestServiceAnnotations(t *testing.T) {
549
549
operatorAnnotations : make (map [string ]string ),
550
550
serviceAnnotations : make (map [string ]string ),
551
551
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" ,
553
553
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
554
554
},
555
555
},
@@ -571,7 +571,7 @@ func TestServiceAnnotations(t *testing.T) {
571
571
operatorAnnotations : make (map [string ]string ),
572
572
serviceAnnotations : make (map [string ]string ),
573
573
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" ,
575
575
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
576
576
},
577
577
},
@@ -583,7 +583,7 @@ func TestServiceAnnotations(t *testing.T) {
583
583
operatorAnnotations : make (map [string ]string ),
584
584
serviceAnnotations : map [string ]string {"foo" : "bar" },
585
585
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" ,
587
587
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
588
588
"foo" : "bar" ,
589
589
},
@@ -606,7 +606,7 @@ func TestServiceAnnotations(t *testing.T) {
606
606
operatorAnnotations : map [string ]string {"foo" : "bar" },
607
607
serviceAnnotations : make (map [string ]string ),
608
608
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" ,
610
610
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
611
611
"foo" : "bar" ,
612
612
},
@@ -621,7 +621,7 @@ func TestServiceAnnotations(t *testing.T) {
621
621
},
622
622
serviceAnnotations : make (map [string ]string ),
623
623
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" ,
625
625
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
626
626
},
627
627
},
@@ -635,7 +635,7 @@ func TestServiceAnnotations(t *testing.T) {
635
635
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
636
636
},
637
637
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" ,
639
639
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
640
640
},
641
641
},
@@ -649,7 +649,7 @@ func TestServiceAnnotations(t *testing.T) {
649
649
"external-dns.alpha.kubernetes.io/hostname" : "wrong.external-dns-name.example.com" ,
650
650
},
651
651
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" ,
653
653
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
654
654
},
655
655
},
@@ -661,7 +661,7 @@ func TestServiceAnnotations(t *testing.T) {
661
661
serviceAnnotations : make (map [string ]string ),
662
662
operatorAnnotations : make (map [string ]string ),
663
663
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" ,
665
665
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
666
666
},
667
667
},
@@ -679,7 +679,7 @@ func TestServiceAnnotations(t *testing.T) {
679
679
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "2000" ,
680
680
},
681
681
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" ,
683
683
"service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" : "ip" ,
684
684
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "2000" ,
685
685
},
@@ -704,7 +704,7 @@ func TestServiceAnnotations(t *testing.T) {
704
704
operatorAnnotations : make (map [string ]string ),
705
705
serviceAnnotations : make (map [string ]string ),
706
706
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" ,
708
708
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
709
709
},
710
710
},
@@ -726,7 +726,7 @@ func TestServiceAnnotations(t *testing.T) {
726
726
operatorAnnotations : make (map [string ]string ),
727
727
serviceAnnotations : make (map [string ]string ),
728
728
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" ,
730
730
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
731
731
},
732
732
},
@@ -738,7 +738,7 @@ func TestServiceAnnotations(t *testing.T) {
738
738
operatorAnnotations : make (map [string ]string ),
739
739
serviceAnnotations : map [string ]string {"foo" : "bar" },
740
740
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" ,
742
742
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
743
743
"foo" : "bar" ,
744
744
},
@@ -761,7 +761,7 @@ func TestServiceAnnotations(t *testing.T) {
761
761
operatorAnnotations : map [string ]string {"foo" : "bar" },
762
762
serviceAnnotations : make (map [string ]string ),
763
763
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" ,
765
765
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
766
766
"foo" : "bar" ,
767
767
},
@@ -776,7 +776,7 @@ func TestServiceAnnotations(t *testing.T) {
776
776
},
777
777
serviceAnnotations : make (map [string ]string ),
778
778
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" ,
780
780
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
781
781
},
782
782
},
@@ -790,7 +790,7 @@ func TestServiceAnnotations(t *testing.T) {
790
790
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
791
791
},
792
792
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" ,
794
794
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "1800" ,
795
795
},
796
796
},
@@ -804,7 +804,7 @@ func TestServiceAnnotations(t *testing.T) {
804
804
"external-dns.alpha.kubernetes.io/hostname" : "wrong.external-dns-name.example.com" ,
805
805
},
806
806
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" ,
808
808
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
809
809
},
810
810
},
@@ -816,7 +816,7 @@ func TestServiceAnnotations(t *testing.T) {
816
816
serviceAnnotations : make (map [string ]string ),
817
817
operatorAnnotations : make (map [string ]string ),
818
818
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" ,
820
820
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "3600" ,
821
821
},
822
822
},
@@ -834,7 +834,7 @@ func TestServiceAnnotations(t *testing.T) {
834
834
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "2000" ,
835
835
},
836
836
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" ,
838
838
"service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" : "ip" ,
839
839
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" : "2000" ,
840
840
},
@@ -867,8 +867,10 @@ func TestServiceAnnotations(t *testing.T) {
867
867
cl .OpConfig .CustomServiceAnnotations = tt .operatorAnnotations
868
868
cl .OpConfig .EnableMasterLoadBalancer = tt .enableMasterLoadBalancerOC
869
869
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}"
872
874
cl .OpConfig .DbHostedZone = "db.example.com"
873
875
874
876
cl .Postgresql .Spec .ClusterName = ""
0 commit comments