Skip to content

Commit 311636a

Browse files
authored
Add svc port fix for sidecar services (#498)
1 parent c11138c commit 311636a

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

changelog/v0.34.2/svc-port-name.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
- type: NEW_FEATURE
3+
issueLink: https://github.com/solo-io/skv2/issues/488
4+
description: >
5+
Allow service port names to contain hyphens for sidecar services.

codegen/cmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ var _ = Describe("Cmd", func() {
152152
Expect(deployment).To(ContainSubstring(fmt.Sprintf("{{ if %s }}", agentConditional)))
153153
Expect(deployment).To(ContainSubstring(fmt.Sprintf("{{ if %s }}", "and ($.Values.glooAgent.enabled) (not $.Values.glooAgent.runAsSidecar)")))
154154
Expect(deployment).To(ContainSubstring("name: agent-volume"))
155-
Expect(deployment).To(ContainSubstring("{{ $glooAgent.ports.grpc }}"))
155+
Expect(deployment).To(ContainSubstring(`{{ index $glooAgent "ports" "grpc" }}`))
156156
Expect(deployment).To(ContainSubstring("{{ $Values.glooMgmtServer.statsPort }}"))
157157
})
158158
It("generates controller code and manifests for a proto file", func() {

codegen/templates/chart/operator-deployment.yamltmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ spec:
297297
ports:
298298
[[- range $port := $container.Service.Ports ]]
299299
- name: [[ lower $port.Name ]]
300-
port: {{ [[ $containerVar ]].ports.[[ $port.Name ]] }}
300+
port: {{ index [[ $containerVar ]] "ports" "[[ $port.Name ]]" }}
301301
[[- end ]]
302302
{{- end }}
303303
[[- end ]]

codegen/test/chart/conditional-sidecar/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ spec:
231231
type: {{ $glooAgent.serviceType }}
232232
ports:
233233
- name: grpc
234-
port: {{ $glooAgent.ports.grpc }}
234+
port: {{ index $glooAgent "ports" "grpc" }}
235235
{{- end }}
236236

237237

0 commit comments

Comments
 (0)