|
@@ -56,6 +56,7 @@ func DockerdInspect(containerID string) (*ContainerMetadata, error) {
|
|
|
volumes: map[string]string{},
|
|
volumes: map[string]string{},
|
|
|
hostListens: map[string][]netaddr.IPPort{},
|
|
hostListens: map[string][]netaddr.IPPort{},
|
|
|
networks: map[string]ContainerNetwork{},
|
|
networks: map[string]ContainerNetwork{},
|
|
|
|
|
+ env: map[string]string{},
|
|
|
}
|
|
}
|
|
|
for _, m := range c.Mounts {
|
|
for _, m := range c.Mounts {
|
|
|
res.volumes[m.Destination] = common.ParseKubernetesVolumeSource(m.Source)
|
|
res.volumes[m.Destination] = common.ParseKubernetesVolumeSource(m.Source)
|
|
@@ -92,6 +93,17 @@ func DockerdInspect(containerID string) (*ContainerMetadata, error) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if c.Config != nil {
|
|
|
|
|
+ for _, value := range c.Config.Env {
|
|
|
|
|
+ idx := strings.Index(value, "=")
|
|
|
|
|
+ if idx < 0 {
|
|
|
|
|
+ continue
|
|
|
|
|
+ }
|
|
|
|
|
+ k := value[:idx]
|
|
|
|
|
+ v := value[idx+1:]
|
|
|
|
|
+ res.env[k] = v
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return res, nil
|
|
return res, nil
|
|
|
}
|
|
}
|
|
|
|
|
|