Skip to content

Commit

Permalink
fix deploy job panic when service contains init container
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zhao <[email protected]>
  • Loading branch information
PetrusZ authored and lilianzhu committed Feb 14, 2025
1 parent e47982d commit 86ec8b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/microservice/aslan/core/common/service/kube/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func ReplaceWorkloadImages(rawYaml string, images []*commonmodels.Container) (st
}

for i, c := range initContainers {
container := c.(map[interface{}]interface{})
container := c.(map[string]interface{})
containerName := container["name"].(string)
if image, ok := imageMap[containerName]; ok {
container["image"] = image.Image
Expand All @@ -198,7 +198,7 @@ func ReplaceWorkloadImages(rawYaml string, images []*commonmodels.Container) (st
}

for i, c := range containers {
container := c.(map[interface{}]interface{})
container := c.(map[string]interface{})
containerName := container["name"].(string)
if image, ok := imageMap[containerName]; ok {
container["image"] = image.Image
Expand All @@ -217,7 +217,7 @@ func ReplaceWorkloadImages(rawYaml string, images []*commonmodels.Container) (st
}

for i, c := range initContainers {
container := c.(map[interface{}]interface{})
container := c.(map[string]interface{})
containerName := container["name"].(string)
if image, ok := imageMap[containerName]; ok {
container["image"] = image.Image
Expand Down

0 comments on commit 86ec8b2

Please sign in to comment.