Change the k8s runtime notifier update to get the deployment and update build

This commit is contained in:
Asim Aslam
2019-11-26 13:49:52 +00:00
parent 12d9c5b187
commit b06854b0d5
3 changed files with 166 additions and 159 deletions

View File

@@ -2,6 +2,7 @@ package kubernetes
import (
"strings"
"time"
"github.com/micro/go-micro/runtime"
"github.com/micro/go-micro/runtime/kubernetes/client"
@@ -34,6 +35,9 @@ func newService(s *runtime.Service, c runtime.CreateOptions) *service {
kdeploy.Metadata.Annotations["owner"] = "micro"
kdeploy.Metadata.Annotations["group"] = "micro"
// set a build timestamp to the current time
kdeploy.Metadata.Annotations["build"] = time.Now().Format(time.RFC3339)
// define the environment values used by the container
env := make([]client.EnvVar, 0, len(c.Env))
for _, evar := range c.Env {