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:
co-authored by
Md Soharab Ansari
parent
0bbb5c5f38
commit
703613a475
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user