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:
Sanket Sudake
2021-06-02 16:23:53 +05:30
committed by GitHub
parent 5f47a25711
commit e6c13057ce
3 changed files with 11 additions and 4 deletions
+7
View File
@@ -571,6 +571,13 @@ func (e *Environment) Validate() error {
validateMetadata("Environment", e.ObjectMeta),
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()
}