Skip to content

Commit c4b5f16

Browse files
authored
fix: Use distinct container port names (#354)
This introduces the port name "php" for the additional PHP container. Using the same port name twice can lead to situations where a service pointing to a named port would route the traffic to the wrong container.
1 parent 475f206 commit c4b5f16

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

internal/servicetypes/nginx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ var nginxPHP = ServiceType{
137137
SecurityContext: &corev1.SecurityContext{},
138138
Ports: []corev1.ContainerPort{
139139
{
140-
Name: "http",
140+
Name: "php",
141141
ContainerPort: defaultPHPPort,
142142
Protocol: corev1.ProtocolTCP,
143143
},

internal/templating/services/test-resources/deployment/result-nginx-1.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ spec:
101101
name: php
102102
ports:
103103
- containerPort: 9000
104-
name: http
104+
name: php
105105
protocol: TCP
106106
readinessProbe:
107107
initialDelaySeconds: 2
@@ -228,7 +228,7 @@ spec:
228228
name: php
229229
ports:
230230
- containerPort: 9000
231-
name: http
231+
name: php
232232
protocol: TCP
233233
readinessProbe:
234234
initialDelaySeconds: 2

internal/templating/services/test-resources/deployment/result-nginx-2.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ spec:
101101
name: php
102102
ports:
103103
- containerPort: 9000
104-
name: http
104+
name: php
105105
protocol: TCP
106106
readinessProbe:
107107
initialDelaySeconds: 2
@@ -229,7 +229,7 @@ spec:
229229
name: php
230230
ports:
231231
- containerPort: 9000
232-
name: http
232+
name: php
233233
protocol: TCP
234234
readinessProbe:
235235
initialDelaySeconds: 2

internal/testdata/complex/service-templates/service1/deployment-nginx-php.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ spec:
104104
name: php
105105
ports:
106106
- containerPort: 9000
107-
name: http
107+
name: php
108108
protocol: TCP
109109
readinessProbe:
110110
initialDelaySeconds: 2

internal/testdata/complex/service-templates/service2/deployment-nginx-php.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ spec:
104104
name: php
105105
ports:
106106
- containerPort: 9000
107-
name: http
107+
name: php
108108
protocol: TCP
109109
readinessProbe:
110110
initialDelaySeconds: 2

internal/testdata/complex/service-templates/service5/deployment-nginx-php.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ spec:
104104
name: php
105105
ports:
106106
- containerPort: 9000
107-
name: http
107+
name: php
108108
protocol: TCP
109109
readinessProbe:
110110
initialDelaySeconds: 2

internal/testdata/complex/service-templates/service6/deployment-nginx-php.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ spec:
114114
name: php
115115
ports:
116116
- containerPort: 9000
117-
name: http
117+
name: php
118118
protocol: TCP
119119
readinessProbe:
120120
initialDelaySeconds: 2

0 commit comments

Comments
 (0)