From deabf0b8c93a55aa190609dfd0124cc9e52ecd7d Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Tue, 26 Nov 2019 14:56:23 +0000 Subject: [PATCH] fix entry into nil map --- runtime/kubernetes/kubernetes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index ccac8ed4..69b032b7 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -226,6 +226,9 @@ func (k *kubernetes) run(events <-chan runtime.Event) { // technically we should not receive multiple versions but hey ho for _, service := range deployed.Items { // update build time annotation + if service.Spec.Template.Metadata.Annotations == nil { + service.Spec.Template.Metadata.Annotations = make(map[string]string) + } service.Spec.Template.Metadata.Annotations["build"] = event.Timestamp.Format(time.RFC3339) log.Debugf("Runtime updating service: %s", event.Service)