Skip to content

Commit

Permalink
chore: Remove support for legacy swarm
Browse files Browse the repository at this point in the history
It doesn't work with the newer Docker Swarm mode so it doesn't have
much value anymore.
  • Loading branch information
rhansen committed Feb 1, 2023
1 parent 1462ff0 commit 2494e20
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,8 @@ upstream {{ .Upstream }} {
# bypass nginx-proxy and access the container's server
# directly.
{{- end }}
{{- if $container.Node.ID }}
# Swarm node name: {{ $container.Node.Name }}
{{- end }}
# Container networks:
{{- range $containerNetwork := sortObjectsByKeysAsc $container.Networks "Name" }}
{{- if eq $containerNetwork.Name "ingress" }}
# {{ $containerNetwork.Name }} (ignored)
{{- continue }}
{{- end }}
{{- if and (not (index $networks $containerNetwork.Name)) (not $networks.host) }}
# {{ $containerNetwork.Name }} (unreachable)
{{- continue }}
Expand All @@ -162,14 +155,7 @@ upstream {{ .Upstream }} {
{{- continue }}
{{- end }}
# {{ $containerNetwork.Name }} (reachable)
{{- /*
* If we got the containers from swarm and this container's
* port is published to host, use host IP:PORT.
*/}}
{{- if and $container.Node.ID $addr_obj $addr_obj.HostPort }}
{{- $ip = $container.Node.Address.IP }}
{{- $port = $addr_obj.HostPort }}
{{- else if and $containerNetwork $containerNetwork.IP }}
{{- if and $containerNetwork $containerNetwork.IP }}
{{- $ip = $containerNetwork.IP }}
{{- else }}
# /!\ No IP for this network!
Expand Down

0 comments on commit 2494e20

Please sign in to comment.