Patch spec template annotations and use event timestmap

This commit is contained in:
Asim Aslam
2019-11-26 17:33:41 +00:00
parent deabf0b8c9
commit 6475c1f3ad
4 changed files with 57 additions and 39 deletions

View File

@@ -36,7 +36,10 @@ func newService(s *runtime.Service, c runtime.CreateOptions) *service {
kdeploy.Metadata.Annotations["group"] = "micro"
// set a build timestamp to the current time
kdeploy.Metadata.Annotations["build"] = time.Now().Format(time.RFC3339)
if kdeploy.Spec.Template.Metadata.Annotations == nil {
kdeploy.Spec.Template.Metadata.Annotations = make(map[string]string)
}
kdeploy.Spec.Template.Metadata.Annotations["build"] = time.Now().Format(time.RFC3339)
// define the environment values used by the container
env := make([]client.EnvVar, 0, len(c.Env))