Repository: nginx/nginx-gateway-fabric

Issue:
NGINX Plus default container image not set properly
If a user doesn't specify a container image for the data plane when using NGINX Plus, the wrong default image is used.

Hints from issue comments:

Solution patch:
diff --git a/internal/controller/provisioner/objects.go b/internal/controller/provisioner/objects.go
index 14b3cbcc..9ed081c2 100644
--- a/internal/controller/provisioner/objects.go
+++ b/internal/controller/provisioner/objects.go
@@ -1113,6 +1113,9 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
 
 func (p *NginxProvisioner) buildImage(nProxyCfg *graph.EffectiveNginxProxy) (string, corev1.PullPolicy) {
 	image := defaultNginxImagePath
+	if p.cfg.Plus {
+		image = defaultNginxPlusImagePath
+	}
 	tag := p.cfg.GatewayPodConfig.Version
 	pullPolicy := defaultImagePullPolicy
 



Test patch:
diff --git a/internal/controller/provisioner/objects_test.go b/internal/controller/provisioner/objects_test.go
index 4af6f2de..e72d1057 100644
--- a/internal/controller/provisioner/objects_test.go
+++ b/internal/controller/provisioner/objects_test.go
@@ -498,6 +498,7 @@ func TestBuildNginxResourceObjects_Plus(t *testing.T) {
 		cfg: Config{
 			GatewayPodConfig: &config.GatewayPodConfig{
 				Namespace: ngfNamespace,
+				Version:   "1.0.0",
 			},
 			Plus: true,
 			PlusUsageConfig: &config.UsageReportConfig{
@@ -611,6 +612,7 @@ func TestBuildNginxResourceObjects_Plus(t *testing.T) {
 		Name:      "nginx-plus-usage-certs",
 		MountPath: "/etc/nginx/certs-bootstrap/",
 	}))
+	g.Expect(container.Image).To(Equal(fmt.Sprintf("%s:1.0.0", defaultNginxPlusImagePath)))
 }
 
 func TestBuildNginxResourceObjects_DockerSecrets(t *testing.T) {