Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to reproduce issue #267 #268

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
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
...