fix: Empty Rancher launch config.

This commit is contained in:
Fernandez Ludovic 2017-05-23 15:56:34 +02:00 committed by Ludovic Fernandez
parent bc0121808a
commit 5b896bb46c

View file

@ -388,9 +388,13 @@ func parseRancherData(environments []*rancher.Environment, services []*rancher.S
Containers: []string{},
}
if service.LaunchConfig == nil || service.LaunchConfig.Labels == nil {
log.Warnf("Rancher Service Labels are missing. Environment: %s, service: %s", environment.Name, service.Name)
} else {
for key, value := range service.LaunchConfig.Labels {
rancherData.Labels[key] = value.(string)
}
}
for _, container := range containers {
if container.Labels["io.rancher.stack_service.name"] == rancherData.Name && containerFilter(container) {