Support annotations in environment specs (#733)

* Added annotations to runtime and builder environment specs
* Use crd annotations for env pod
This commit is contained in:
Erwin van Eyk
2018-06-30 05:38:22 +08:00
committed by Ta-Ching Chen
parent 65fd1d9fbb
commit 032d1a8b9a
4 changed files with 159 additions and 10 deletions
+6 -3
View File
@@ -185,9 +185,12 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *crd.Function, env *crd.Environmen
return nil, err
}
podAnnotation := make(map[string]string)
podAnnotations := env.Metadata.Annotations
if podAnnotations == nil {
podAnnotations = make(map[string]string)
}
if deploy.useIstio && env.Spec.AllowAccessToExternalNetwork {
podAnnotation["sidecar.istio.io/inject"] = "false"
podAnnotations["sidecar.istio.io/inject"] = "false"
}
resources := deploy.getResources(env, fn)
@@ -204,7 +207,7 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *crd.Function, env *crd.Environmen
Template: apiv1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: deployLabels,
Annotations: podAnnotation,
Annotations: podAnnotations,
},
Spec: apiv1.PodSpec{
Volumes: []apiv1.Volume{