Change container name for runtime container to environment name in newdeploy (#2044)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -571,6 +571,13 @@ func (e *Environment) Validate() error {
|
|||||||
validateMetadata("Environment", e.ObjectMeta),
|
validateMetadata("Environment", e.ObjectMeta),
|
||||||
e.Spec.Validate())
|
e.Spec.Validate())
|
||||||
|
|
||||||
|
if e.Spec.Runtime.PodSpec != nil {
|
||||||
|
for _, container := range e.Spec.Runtime.PodSpec.Containers {
|
||||||
|
if container.Command == nil && container.Image == e.Spec.Runtime.Image && container.Name != e.ObjectMeta.Name {
|
||||||
|
multierror.Append(result, fmt.Errorf("container with image same as runtime image in podspec, must have name same as environment name"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return result.ErrorOrNil()
|
return result.ErrorOrNil()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *fv1.Function, env *fv1.Environmen
|
|||||||
}
|
}
|
||||||
|
|
||||||
container, err := util.MergeContainer(&apiv1.Container{
|
container, err := util.MergeContainer(&apiv1.Container{
|
||||||
Name: fn.ObjectMeta.Name,
|
Name: env.ObjectMeta.Name,
|
||||||
Image: env.Spec.Runtime.Image,
|
Image: env.Spec.Runtime.Image,
|
||||||
ImagePullPolicy: deploy.runtimeImagePullPolicy,
|
ImagePullPolicy: deploy.runtimeImagePullPolicy,
|
||||||
TerminationMessagePath: "/dev/termination-log",
|
TerminationMessagePath: "/dev/termination-log",
|
||||||
@@ -312,7 +312,7 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *fv1.Function, env *fv1.Environmen
|
|||||||
// Order of merging is important here - first fetcher, then containers and lastly pod spec
|
// Order of merging is important here - first fetcher, then containers and lastly pod spec
|
||||||
err = deploy.fetcherConfig.AddSpecializingFetcherToPodSpec(
|
err = deploy.fetcherConfig.AddSpecializingFetcherToPodSpec(
|
||||||
&deployment.Spec.Template.Spec,
|
&deployment.Spec.Template.Spec,
|
||||||
fn.ObjectMeta.Name,
|
env.ObjectMeta.Name,
|
||||||
fn,
|
fn,
|
||||||
env,
|
env,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ spec:
|
|||||||
runtime:
|
runtime:
|
||||||
image: fission/node-env
|
image: fission/node-env
|
||||||
container:
|
container:
|
||||||
name: nodehellond
|
name: nodend
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: cvol
|
- name: cvol
|
||||||
mountPath: /etc/cvoldata
|
mountPath: /etc/cvoldata
|
||||||
@@ -22,7 +22,7 @@ spec:
|
|||||||
hostname: foo-bar
|
hostname: foo-bar
|
||||||
# A container which will be merged with for pool manager
|
# A container which will be merged with for pool manager
|
||||||
containers:
|
containers:
|
||||||
- name: nodehellond
|
- name: nodend
|
||||||
image: fission/node-env
|
image: fission/node-env
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: funcvol
|
- name: funcvol
|
||||||
|
|||||||
Reference in New Issue
Block a user