Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions generator/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func TestContainers_ManualIngressNetworks(t *testing.T) {
" reverse_proxy 10.0.0.1\n" +
"}\n"

const expectedLogs = otherIngressNetworksMapLog + swarmIsAvailableLog
const expectedLogs = swarmIsAvailableLog

testGeneration(t, dockerClient, func(options *config.Options) {
options.IngressNetworks = []string{"other-network-name"}
Expand Down Expand Up @@ -177,7 +177,7 @@ func TestContainers_OverrideIngressNetworks(t *testing.T) {
" reverse_proxy 10.0.0.2\n" +
"}\n"

const expectedLogs = otherIngressNetworksMapLog + swarmIsAvailableLog
const expectedLogs = swarmIsAvailableLog

testGeneration(t, dockerClient, func(options *config.Options) {
options.IngressNetworks = []string{"other-network-name"}
Expand Down
4 changes: 1 addition & 3 deletions generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ var caddyNetworkName = "network-name"

const newLine = "\n"
const containerIdLog = `INFO Caddy ContainerID {"ID": "container-id"}` + newLine
const ingressNetworksMapLog = `INFO IngressNetworksMap {"ingres": "map[network-id:true network-name:true]"}` + newLine
const otherIngressNetworksMapLog = `INFO IngressNetworksMap {"ingres": "map[other-network-id:true other-network-name:true]"}` + newLine
const swarmIsAvailableLog = `INFO Swarm is available {"new": true}` + newLine
const swarmIsDisabledLog = `INFO Swarm is available {"new": false}` + newLine
const commonLogs = containerIdLog + ingressNetworksMapLog + swarmIsAvailableLog
const commonLogs = containerIdLog + swarmIsAvailableLog

func init() {
log.SetOutput(io.Discard)
Expand Down
8 changes: 4 additions & 4 deletions generator/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func TestServices_ManualIngressNetwork(t *testing.T) {
" reverse_proxy service\n" +
"}\n"

const expectedLogs = otherIngressNetworksMapLog + swarmIsAvailableLog
const expectedLogs = swarmIsAvailableLog

testGeneration(t, dockerClient, func(options *config.Options) {
options.IngressNetworks = []string{"other-network-name"}
Expand Down Expand Up @@ -170,7 +170,7 @@ func TestServices_SwarmDisabled(t *testing.T) {

const expectedCaddyfile = "# Empty caddyfile"

const expectedLogs = containerIdLog + ingressNetworksMapLog + swarmIsDisabledLog
const expectedLogs = containerIdLog + swarmIsDisabledLog

testGeneration(t, dockerClient, nil, expectedCaddyfile, expectedLogs)
}
Expand Down Expand Up @@ -375,7 +375,7 @@ func TestServiceTasks_ManualIngressNetwork(t *testing.T) {
" reverse_proxy 10.0.0.1:5000\n" +
"}\n"

const expectedLogs = otherIngressNetworksMapLog + swarmIsAvailableLog
const expectedLogs = swarmIsAvailableLog

testGeneration(t, dockerClient, func(options *config.Options) {
options.ProxyServiceTasks = true
Expand Down Expand Up @@ -453,7 +453,7 @@ func TestServiceTasks_OverrideIngressNetwork(t *testing.T) {
" reverse_proxy 10.0.0.2:5000\n" +
"}\n"

const expectedLogs = otherIngressNetworksMapLog + swarmIsAvailableLog
const expectedLogs = swarmIsAvailableLog

testGeneration(t, dockerClient, func(options *config.Options) {
options.ProxyServiceTasks = true
Expand Down
Loading