1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00

fix entry into nil map

This commit is contained in:
Asim Aslam 2019-11-26 14:56:23 +00:00
parent 04ee4b04ad
commit deabf0b8c9

View File

@ -226,6 +226,9 @@ func (k *kubernetes) run(events <-chan runtime.Event) {
// technically we should not receive multiple versions but hey ho // technically we should not receive multiple versions but hey ho
for _, service := range deployed.Items { for _, service := range deployed.Items {
// update build time annotation // 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) service.Spec.Template.Metadata.Annotations["build"] = event.Timestamp.Format(time.RFC3339)
log.Debugf("Runtime updating service: %s", event.Service) log.Debugf("Runtime updating service: %s", event.Service)