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 -4
View File
@@ -485,10 +485,12 @@ func (gp *GenericPool) createPool() error {
gracePeriodSeconds = gp.env.Spec.TerminationGracePeriod
}
podAnnotation := make(map[string]string)
podAnnotations := gp.env.Metadata.Annotations
if podAnnotations == nil {
podAnnotations = make(map[string]string)
}
if gp.useIstio && gp.env.Spec.AllowAccessToExternalNetwork {
podAnnotation["sidecar.istio.io/inject"] = "false"
podAnnotations["sidecar.istio.io/inject"] = "false"
}
deployment := &v1beta1.Deployment{
@@ -504,7 +506,7 @@ func (gp *GenericPool) createPool() error {
Template: apiv1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: gp.labelsForPool,
Annotations: podAnnotation,
Annotations: podAnnotations,
},
Spec: apiv1.PodSpec{
Volumes: []apiv1.Volume{