Skip to content

Commit 90dd652

Browse files
committed
fix(push-chart): label plaintext gateway service as HTTP
Signed-off-by: Tom Brow <[email protected]>
1 parent 779af88 commit 90dd652

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎deploy/charts/buzz-push-gateway/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ apiVersion: v2
33
# branches (see docs/push-gateway-deployment.md, "Gateway chart release").
44
name: buzz-push-gateway
55
description: Public capability-gated APNs last-hop gateway for Buzz
6-
version: 0.3.0
6+
version: 0.3.1
77
appVersion: "0.1.0"
88
type: application

‎deploy/charts/buzz-push-gateway/templates/service.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ metadata:
66
spec:
77
selector: {{- include "push.runtimeLabels" . | nindent 4 }}
88
ports:
9-
- { name: https, port: {{ .Values.service.port }}, targetPort: public }
9+
- { name: http, port: {{ .Values.service.port }}, targetPort: public }

‎deploy/charts/buzz-push-gateway/tests/render.sh‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ def assert!(condition, detail = "assertion failed")
3434
raise detail unless condition
3535
end
3636
37+
# The application serves plaintext HTTP behind ingress TLS termination. Check
38+
# every ingress mode so service discovery never advertises application TLS.
39+
ARGV.each do |path|
40+
resources = YAML.load_stream(File.read(path)).compact
41+
service = resources.find { |x| x["kind"] == "Service" }
42+
ports = service.dig("spec", "ports")
43+
assert!(ports == [{ "name" => "http", "port" => 8080, "targetPort" => "public" }], ports.inspect)
44+
deployment = resources.find { |x| x["kind"] == "Deployment" }
45+
container_ports = deployment.dig("spec", "template", "spec", "containers", 0, "ports")
46+
assert!(container_ports.any? { |port| port["name"] == "public" && port["containerPort"] == 8080 })
47+
end
48+
3749
xs = YAML.load_stream(File.read(ARGV[0])).compact
3850
svc = xs.find { |x| x["kind"] == "Service" }
3951
assert!(svc.dig("spec", "ports").map { |port| port["targetPort"] } == ["public"])

0 commit comments

Comments
 (0)