diff options
Diffstat (limited to 'skate')
-rw-r--r-- | skate/map.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/skate/map.go b/skate/map.go index 1d21818..334471c 100644 --- a/skate/map.go +++ b/skate/map.go @@ -245,15 +245,19 @@ func MapperReleaseContainerName(p []byte) (fields [][]byte, err error) { var ( doc Release key []byte + w string ) if err := json.Unmarshal(p, &doc); err != nil { return nil, err } if doc.Container.Name != "" { - key = []byte(sandcrawlerSlugify(wsReplacer.Replace(strings.TrimSpace(doc.Container.Name)))) + w = doc.Container.Name } else if doc.ContainerName != "" { - key = []byte(sandcrawlerSlugify(wsReplacer.Replace(strings.TrimSpace(doc.ContainerName)))) + w = doc.ContainerName + } else { + w = doc.Extra.ContainerName } + key = []byte(sandcrawlerSlugify(wsReplacer.Replace(strings.TrimSpace(w)))) return [][]byte{key, p}, nil } |