Skip to content

Commit fa56533

Browse files
committed
test: Ensure the service has the correct labels
Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
1 parent b0ef3bf commit fa56533

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

internal/controller/policyserver_controller_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ var _ = Describe("PolicyServer controller", func() {
608608
}).Should(Succeed())
609609
})
610610

611-
It("should create service with owner reference", func() {
611+
It("should create service with owner reference and correct labels", func() {
612612
policyServer := policiesv1.NewPolicyServerFactory().WithName(policyServerName).Build()
613613
createPolicyServerAndWaitForItsService(ctx, policyServer)
614614

@@ -640,6 +640,11 @@ var _ = Describe("PolicyServer controller", func() {
640640
"Port": Equal(int32(constants.PolicyServerPort)),
641641
"TargetPort": Equal(intstr.IntOrString{IntVal: int32(constants.PolicyServerPort)}),
642642
})))
643+
// This checks that the service has the legacy and recommended labels
644+
// TODO simplify this with a future release
645+
for k, v := range policyServer.CommonLabels() {
646+
Expect(service.ObjectMeta.Labels).To(HaveKeyWithValue(k, v))
647+
}
643648
return nil
644649
}).Should(Succeed())
645650
})

0 commit comments

Comments
 (0)