Skip to content

Commit

Permalink
fix: remove container's ports field
Browse files Browse the repository at this point in the history
Signed-off-by: Kebe <[email protected]>
  • Loading branch information
kebe7jun committed Nov 19, 2024
1 parent 8a01dd6 commit 10e5730
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
21 changes: 0 additions & 21 deletions internal/infrastructure/kubernetes/proxy/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,6 @@ func expectedProxyContainers(infra *ir.ProxyInfra,
// Define slice to hold container ports
var ports []corev1.ContainerPort

// Iterate over listeners and ports to get container ports
for _, listener := range infra.Listeners {
for _, p := range listener.Ports {
var protocol corev1.Protocol
switch p.Protocol {
case ir.HTTPProtocolType, ir.HTTPSProtocolType, ir.TLSProtocolType, ir.TCPProtocolType:
protocol = corev1.ProtocolTCP
case ir.UDPProtocolType:
protocol = corev1.ProtocolUDP
default:
return nil, fmt.Errorf("invalid protocol %q", p.Protocol)
}
port := corev1.ContainerPort{
Name: p.Name,
ContainerPort: p.ContainerPort,
Protocol: protocol,
}
ports = append(ports, port)
}
}

if enablePrometheus(infra) {
ports = append(ports, corev1.ContainerPort{
Name: "metrics",
Expand Down
2 changes: 1 addition & 1 deletion release-notes/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ date: Pending

# Changes that are expected to cause an incompatibility with previous versions, such as deletions or modifications to existing APIs.
breaking changes: |
Add a breaking change here
The Container `ports` field of the gateway instance has been removed, which will cause the gateway Pod to be rebuilt when upgrading the version.
# Updates addressing vulnerabilities, security flaws, or compliance requirements.
security updates: |
Expand Down

0 comments on commit 10e5730

Please sign in to comment.