Skip to content

Commit

Permalink
trying to reproduce issue #267
Browse files Browse the repository at this point in the history
relates to #267
  • Loading branch information
gesellix committed Mar 14, 2022
1 parent 0f7f30e commit 15fe40e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.gesellix.docker.client.stack

import de.gesellix.docker.client.DockerClient
import de.gesellix.docker.client.DockerClientImpl
import de.gesellix.docker.client.stack.types.StackConfig
import de.gesellix.docker.client.stack.types.StackSecret
import de.gesellix.docker.compose.types.Command
Expand Down Expand Up @@ -30,6 +31,7 @@ import de.gesellix.docker.remote.api.EndpointSpec
import de.gesellix.docker.remote.api.HealthConfig
import de.gesellix.docker.remote.api.IPAM
import de.gesellix.docker.remote.api.Limit
import de.gesellix.docker.remote.api.LocalNodeState
import de.gesellix.docker.remote.api.Mount
import de.gesellix.docker.remote.api.MountBindOptions
import de.gesellix.docker.remote.api.MountVolumeOptions
Expand Down Expand Up @@ -664,4 +666,27 @@ class DeployConfigReaderTest extends Specification {
"key1=value1"
]
}

def "issue-276"() {
given:
def config1 = new de.gesellix.docker.compose.types.StackConfig()
def config1File = getClass().getResource('/configs/issue-267.yaml').file
def config1FileDirectory = new File(config1File).parent
config1.file = 'issue-267.yaml'

reader.dockerClient = new DockerClientImpl()
if (reader.dockerClient.info().content.swarm.localNodeState == LocalNodeState.Inactive) {
reader.dockerClient.initSwarm()
}
// reader.dockerClient.createNetwork("ingress-routing")

when:
def result = reader.loadCompose(
"name-space",
new FileInputStream(config1File),
config1FileDirectory, System.getenv())

then:
!result.networks?.isEmpty()
}
}
32 changes: 32 additions & 0 deletions client/src/test/resources/configs/issue-267.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
version: 3.9
services:
xmdb:
image: xmdb
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: secret
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "6012:5432"
networks: [xmnet-zh]
volumes: [/opt/containers/xm/zh:/var/lib/postgresql/data]
deploy:
replicas: 1
xmapp:
depends_on: [xmdb]
image: xmapp
ports: ["9012:8080"]
networks: [xmnet-zh, ingress]
deploy:
replicas: 1
labels:
ingress.host: zh.xm.local
ingress.port: 8080
networks:
xmnet-zh:
ingress:
external: true
# ingress-routing:
# external: true
...

0 comments on commit 15fe40e

Please sign in to comment.