@@ -91,13 +91,13 @@ func TestBuildNginxResourceObjects(t *testing.T) {
9191 }
9292
9393 expLabels := map [string ]string {
94- "label" : "value" ,
95- "app" : "nginx" ,
96- "app.kubernetes.io/name" : "gw-nginx" ,
94+ "label" : "value" ,
95+ "app" : "nginx" ,
96+ "gateway.networking.k8s.io/gateway-name" : "gw" ,
97+ "app.kubernetes.io/name" : "gw-nginx" ,
9798 }
9899 expAnnotations := map [string ]string {
99- "annotation" : "value" ,
100- "gateway.networking.k8s.io/gateway-name" : "gw" ,
100+ "annotation" : "value" ,
101101 }
102102
103103 resourceName := "gw-nginx"
@@ -627,13 +627,13 @@ func TestBuildNginxResourceObjects_Plus(t *testing.T) {
627627 g .Expect (objects ).To (HaveLen (9 ))
628628
629629 expLabels := map [string ]string {
630- "label" : "value" ,
631- "app" : "nginx" ,
632- "app.kubernetes.io/name" : "gw-nginx" ,
630+ "label" : "value" ,
631+ "app" : "nginx" ,
632+ "gateway.networking.k8s.io/gateway-name" : "gw" ,
633+ "app.kubernetes.io/name" : "gw-nginx" ,
633634 }
634635 expAnnotations := map [string ]string {
635- "annotation" : "value" ,
636- "gateway.networking.k8s.io/gateway-name" : "gw" ,
636+ "annotation" : "value" ,
637637 }
638638
639639 secretObj := objects [1 ]
@@ -770,19 +770,16 @@ func TestBuildNginxResourceObjects_DockerSecrets(t *testing.T) {
770770 g .Expect (objects ).To (HaveLen (9 ))
771771
772772 expLabels := map [string ]string {
773- "app" : "nginx" ,
774- "app.kubernetes.io/name" : "gw-nginx" ,
775- }
776- expAnnotations := map [string ]string {
773+ "app" : "nginx" ,
777774 "gateway.networking.k8s.io/gateway-name" : "gw" ,
775+ "app.kubernetes.io/name" : "gw-nginx" ,
778776 }
779777
780778 secretObj := objects [0 ]
781779 secret , ok := secretObj .(* corev1.Secret )
782780 g .Expect (ok ).To (BeTrue ())
783781 g .Expect (secret .GetName ()).To (Equal (controller .CreateNginxResourceName (resourceName , agentTLSTestSecretName )))
784782 g .Expect (secret .GetLabels ()).To (Equal (expLabels ))
785- g .Expect (secret .GetAnnotations ()).To (Equal (expAnnotations ))
786783
787784 // the (docker-only) secret order in the object list is sorted by secret name
788785
@@ -791,21 +788,18 @@ func TestBuildNginxResourceObjects_DockerSecrets(t *testing.T) {
791788 g .Expect (ok ).To (BeTrue ())
792789 g .Expect (secret .GetName ()).To (Equal (controller .CreateNginxResourceName (resourceName , dockerTestSecretName )))
793790 g .Expect (secret .GetLabels ()).To (Equal (expLabels ))
794- g .Expect (secret .GetAnnotations ()).To (Equal (expAnnotations ))
795791
796792 registry1SecretObj := objects [2 ]
797793 secret , ok = registry1SecretObj .(* corev1.Secret )
798794 g .Expect (ok ).To (BeTrue ())
799795 g .Expect (secret .GetName ()).To (Equal (controller .CreateNginxResourceName (resourceName , dockerSecretRegistry1Name )))
800796 g .Expect (secret .GetLabels ()).To (Equal (expLabels ))
801- g .Expect (secret .GetAnnotations ()).To (Equal (expAnnotations ))
802797
803798 registry2SecretObj := objects [3 ]
804799 secret , ok = registry2SecretObj .(* corev1.Secret )
805800 g .Expect (ok ).To (BeTrue ())
806801 g .Expect (secret .GetName ()).To (Equal (controller .CreateNginxResourceName (resourceName , dockerSecretRegistry2Name )))
807802 g .Expect (secret .GetLabels ()).To (Equal (expLabels ))
808- g .Expect (secret .GetAnnotations ()).To (Equal (expAnnotations ))
809803
810804 depObj := objects [8 ]
811805 dep , ok := depObj .(* appsv1.Deployment )
@@ -889,18 +883,15 @@ func TestBuildNginxResourceObjects_DaemonSet(t *testing.T) {
889883 g .Expect (objects ).To (HaveLen (6 ))
890884
891885 expLabels := map [string ]string {
892- "app" : "nginx" ,
893- "app.kubernetes.io/name" : "gw-nginx" ,
894- }
895- expAnnotations := map [string ]string {
886+ "app" : "nginx" ,
896887 "gateway.networking.k8s.io/gateway-name" : "gw" ,
888+ "app.kubernetes.io/name" : "gw-nginx" ,
897889 }
898890
899891 dsObj := objects [5 ]
900892 ds , ok := dsObj .(* appsv1.DaemonSet )
901893 g .Expect (ok ).To (BeTrue ())
902894 g .Expect (ds .GetLabels ()).To (Equal (expLabels ))
903- g .Expect (ds .GetAnnotations ()).To (Equal (expAnnotations ))
904895
905896 template := ds .Spec .Template
906897 g .Expect (template .GetAnnotations ()).To (HaveKey ("prometheus.io/scrape" ))
@@ -956,24 +947,20 @@ func TestBuildNginxResourceObjects_OpenShift(t *testing.T) {
956947 g .Expect (objects ).To (HaveLen (8 ))
957948
958949 expLabels := map [string ]string {
959- "app" : "nginx" ,
960- "app.kubernetes.io/name" : "gw-nginx" ,
961- }
962- expAnnotations := map [string ]string {
950+ "app" : "nginx" ,
963951 "gateway.networking.k8s.io/gateway-name" : "gw" ,
952+ "app.kubernetes.io/name" : "gw-nginx" ,
964953 }
965954
966955 roleObj := objects [4 ]
967956 role , ok := roleObj .(* rbacv1.Role )
968957 g .Expect (ok ).To (BeTrue ())
969958 g .Expect (role .GetLabels ()).To (Equal (expLabels ))
970- g .Expect (role .GetAnnotations ()).To (Equal (expAnnotations ))
971959
972960 roleBindingObj := objects [5 ]
973961 roleBinding , ok := roleBindingObj .(* rbacv1.RoleBinding )
974962 g .Expect (ok ).To (BeTrue ())
975963 g .Expect (roleBinding .GetLabels ()).To (Equal (expLabels ))
976- g .Expect (roleBinding .GetAnnotations ()).To (Equal (expAnnotations ))
977964}
978965
979966func TestBuildNginxResourceObjects_DataplaneKeySecret (t * testing.T ) {
0 commit comments