Skip to content

Commit f01bfba

Browse files
committed
Add another test
1 parent 4017d5f commit f01bfba

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

internal/controller/provisioner/provisioner_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/nginx/nginx-gateway-fabric/v2/internal/controller/provisioner/openshift/openshiftfakes"
2626
"github.com/nginx/nginx-gateway-fabric/v2/internal/controller/state/graph"
2727
"github.com/nginx/nginx-gateway-fabric/v2/internal/framework/controller"
28+
"github.com/nginx/nginx-gateway-fabric/v2/internal/framework/controller/controllerfakes"
2829
"github.com/nginx/nginx-gateway-fabric/v2/internal/framework/helpers"
2930
)
3031

@@ -558,3 +559,21 @@ func TestProvisionerRestartsDaemonSet(t *testing.T) {
558559
g.Expect(fakeClient.Get(context.TODO(), key, ds)).To(Succeed())
559560
g.Expect(ds.Spec.Template.GetAnnotations()).To(HaveKey(controller.RestartedAnnotation))
560561
}
562+
563+
func TestDefaultLabelCollectorFactory(t *testing.T) {
564+
t.Parallel()
565+
g := NewWithT(t)
566+
567+
mgr := &controllerfakes.FakeManager{}
568+
569+
cfg := Config{
570+
GatewayPodConfig: &config.GatewayPodConfig{
571+
Namespace: "pod-namespace",
572+
Name: "pod-name",
573+
Version: "my-version",
574+
},
575+
}
576+
577+
collector := defaultLabelCollectorFactory(mgr, cfg)
578+
g.Expect(collector).NotTo(BeNil())
579+
}

0 commit comments

Comments
 (0)