Skip to content

Commit abefe49

Browse files
committed
hostPort consistent naming
1 parent cc0b116 commit abefe49

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

apis/v1alpha2/nginxproxy_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,13 +616,13 @@ type NodePort struct {
616616

617617
// HostPort exposes an nginx container port on the host.
618618
type HostPort struct {
619-
// ContainerPort is the port on the nginx container to map to the HostPort.
619+
// Number of port to expose on the host.
620620
// kubebuilder:validation:Minimum=1
621621
// kubebuilder:validation:Maximum=65535
622-
ContainerPort int32 `json:"containerPort"`
622+
Port int32 `json:"port"`
623623

624-
// Number of port to expose on the host.
624+
// ContainerPort is the port on the nginx container to map to the HostPort.
625625
// kubebuilder:validation:Minimum=1
626626
// kubebuilder:validation:Maximum=65535
627-
HostPort int32 `json:"hostPort"`
627+
ContainerPort int32 `json:"containerPort"`
628628
}

charts/nginx-gateway-fabric/values.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
"required": [],
325325
"type": "integer"
326326
},
327-
"hostPort": {
327+
"port": {
328328
"maximum": 65535,
329329
"minimum": 1,
330330
"required": [],

charts/nginx-gateway-fabric/values.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,21 +406,21 @@ nginx:
406406
# items:
407407
# type: object
408408
# properties:
409-
# containerPort:
409+
# port:
410410
# type: integer
411411
# required: true
412412
# minimum: 1
413413
# maximum: 65535
414-
# hostPort:
414+
# containerPort:
415415
# type: integer
416416
# required: true
417417
# minimum: 1
418418
# maximum: 65535
419419
# @schema
420420
# -- The hostPort configuration
421421
hostPorts: []
422-
# - containerPort: 80
423-
# hostPort: 80
422+
# - port: 80
423+
# containerPort: 80
424424

425425
# -- The resource requirements of the NGINX container.
426426
# resources: {}

config/crd/bases/gateway.nginx.org_nginxproxies.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,17 +341,17 @@ spec:
341341
description: |-
342342
List of ports to expose on the host.
343343
items:
344-
containerPort:
344+
port:
345345
description: |-
346-
ContainerPort number of nginx
346+
HostPort number to expose on the host
347347
type: integer
348-
hostPort:
348+
containerPort:
349349
description: |-
350-
HostPort number to expose on the host
350+
ContainerPort number of nginx
351351
type: integer
352352
required:
353+
- port
353354
- containerPort
354-
- hostPort
355355
type: array
356356
resources:
357357
description: Resources describes the compute resource

deploy/crds.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -926,17 +926,17 @@ spec:
926926
description: |-
927927
List of ports to expose on the host.
928928
items:
929-
containerPort:
929+
port:
930930
description: |-
931-
ContainerPort of nginx
931+
HostPort number to expose on the host
932932
type: integer
933-
hostPort:
933+
containerPort:
934934
description: |-
935-
HostPort number to expose on the host
935+
ContainerPort of nginx
936936
type: integer
937937
required:
938+
- port
938939
- containerPort
939-
- hostPort
940940
type: array
941941
resources:
942942
description: Resources describes the compute resource

internal/controller/provisioner/objects.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
784784
for _, hostPort := range containerSpec.HostPorts {
785785
for i, port := range container.Ports {
786786
if hostPort.ContainerPort == port.ContainerPort {
787-
container.Ports[i].HostPort = hostPort.HostPort
787+
container.Ports[i].HostPort = hostPort.Port
788788
}
789789
}
790790
}

internal/controller/provisioner/objects_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ func TestBuildNginxResourceObjects_NginxProxyConfig(t *testing.T) {
298298
corev1.ResourceCPU: resource.Quantity{Format: "100m"},
299299
},
300300
},
301-
HostPorts: []ngfAPIv1alpha2.HostPort{{ContainerPort: int32(8443), HostPort: int32(8443)}},
301+
HostPorts: []ngfAPIv1alpha2.HostPort{{ContainerPort: int32(8443), Port: int32(8443)}},
302302
},
303303
},
304304
},

0 commit comments

Comments
 (0)