mirror of
https://github.com/containrrr/watchtower.git
synced 2026-02-24 08:04:07 +01:00
add container network mode test
This commit is contained in:
parent
e8b208e9ac
commit
3b750c2b27
8 changed files with 954 additions and 17 deletions
|
|
@ -216,6 +216,19 @@ var _ = Describe("the client", func() {
|
|||
Expect(containers).NotTo(ContainElement(havingRestartingState(true)))
|
||||
})
|
||||
})
|
||||
When(`a container uses container network mode`, func() {
|
||||
It("should return the container name instead of the ID", func() {
|
||||
mockServer.AppendHandlers(mocks.GetContainerHandlers("net_consumer")...)
|
||||
client := dockerClient{
|
||||
api: docker,
|
||||
ClientOptions: ClientOptions{PullImages: false},
|
||||
}
|
||||
container, err := client.GetContainer(mocks.NetConsumerID)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
networkMode := container.ContainerInfo().HostConfig.NetworkMode
|
||||
Expect(networkMode.ConnectedContainer()).To(Equal(mocks.NetProducerContainerName))
|
||||
})
|
||||
})
|
||||
})
|
||||
Describe(`ExecuteCommand`, func() {
|
||||
When(`logging`, func() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue