fix: custom runtime container name is invalid (#3065)

* fix: custom runtime container name is invalid

* lint: pkg/executor/executortype/newdeploy/newdeploy.go

* Custom name for runtime container

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Co-authored-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
This commit is contained in:
mr-chenguang
2025-01-20 16:41:18 +05:30
committed by GitHub
co-authored by Md Soharab Ansari
parent 0bbb5c5f38
commit 703613a475
4 changed files with 38 additions and 2 deletions
+10
View File
@@ -168,3 +168,13 @@ func CreateDumpFile(logger *zap.Logger) (*os.File, error) {
return os.Create(fmt.Sprintf("%s/%s-%d.txt", dumpPath, dumpFileName, time.Now().Unix()))
}
// DoesContainerExistInPodSpec checks if the container with the given name exists in the pod spec
func DoesContainerExistInPodSpec(containerName string, podSpec *apiv1.PodSpec) bool {
for _, container := range podSpec.Containers {
if container.Name == containerName {
return true
}
}
return false
}