Skip to content

Commit df69486

Browse files
committed
Add Mounts
Based off of #119
1 parent 5043565 commit df69486

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ type RuntimeContainer struct {
211211
IP string
212212
IP6LinkLocal string
213213
IP6Global string
214+
Mounts []Mount
214215
}
215216

216217
type Address struct {
@@ -241,6 +242,15 @@ type DockerImage struct {
241242
Tag string
242243
}
243244

245+
type Mount struct {
246+
Name string
247+
Source string
248+
Destination string
249+
Driver string
250+
Mode string
251+
RW bool
252+
}
253+
244254
type Volume struct {
245255
Path string
246256
HostPath string

context.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ type RuntimeContainer struct {
8989
IP string
9090
IP6LinkLocal string
9191
IP6Global string
92+
Mounts []Mount
9293
}
9394

9495
func (r *RuntimeContainer) Equals(o RuntimeContainer) bool {
@@ -128,6 +129,15 @@ type SwarmNode struct {
128129
Address Address
129130
}
130131

132+
type Mount struct {
133+
Name string
134+
Source string
135+
Destination string
136+
Driver string
137+
Mode string
138+
RW bool
139+
}
140+
131141
type Docker struct {
132142
Name string
133143
NumContainers int

generator.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,17 @@ func (g *generator) getContainers(client *docker.Client) ([]*RuntimeContainer, e
337337
}
338338
}
339339

340+
for _, v := range container.Mounts {
341+
runtimeContainer.Mounts = append(runtimeContainer.Mounts, Mount{
342+
Name: v.Name,
343+
Source: v.Source,
344+
Destination: v.Destination,
345+
Driver: v.Driver,
346+
Mode: v.Mode,
347+
RW: v.RW,
348+
})
349+
}
350+
340351
runtimeContainer.Env = splitKeyValueSlice(container.Config.Env)
341352
runtimeContainer.Labels = container.Config.Labels
342353
containers = append(containers, runtimeContainer)

0 commit comments

Comments
 (0)