Add Container object to environment build and runtime specs (#413)

Environment Specs so far had only an image URL to specify a container image.

This was fine for public images but fell short in a few of cases:
(a) Using private image registries
(b) Specifying environment variables (this is needed for workflows helm install)
(c) Setting a SecurityContext for the container

This change adds the Container object to both build and runtime Environments. 

Compatibility is preserved -- the existing ImageURL field is still used.  See the comments in types.go for the overriding rules in the case that both Container and ImageURL are specified.
This commit is contained in:
Erwin van Eyk
2018-03-22 00:13:02 -07:00
committed by Soam Vasani
parent c76b6bacc0
commit 70a93a7302
14 changed files with 363 additions and 43 deletions
+2 -2
View File
@@ -193,7 +193,7 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *crd.Function, env *crd.Environmen
},
},
Containers: []apiv1.Container{
{
fission.MergeContainerSpecs(&apiv1.Container{
Name: fn.Metadata.Name,
Image: env.Spec.Runtime.Image,
ImagePullPolicy: apiv1.PullIfNotPresent,
@@ -223,7 +223,7 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *crd.Function, env *crd.Environmen
},
},
Resources: resources,
},
}, env.Spec.Runtime.Container),
{
Name: "fetcher",
Image: deploy.fetcherImg,
+2 -2
View File
@@ -524,7 +524,7 @@ func (gp *GenericPool) createPool() error {
},
},
Containers: []apiv1.Container{
{
fission.MergeContainerSpecs(&apiv1.Container{
Name: gp.env.Metadata.Name,
Image: gp.env.Spec.Runtime.Image,
ImagePullPolicy: gp.runtimeImagePullPolicy,
@@ -560,7 +560,7 @@ func (gp *GenericPool) createPool() error {
},
},
},
},
}, gp.env.Spec.Runtime.Container),
{
Name: "fetcher",
Image: gp.fetcherImage,