(ctx devspacecontext.Context, devPod *latest.DevPod, devContainer *latest.DevContainer, podTemplate *corev1.PodTemplateSpec)
| 469 | } |
| 470 | |
| 471 | func replaceImage(ctx devspacecontext.Context, devPod *latest.DevPod, devContainer *latest.DevContainer, podTemplate *corev1.PodTemplateSpec) error { |
| 472 | if devContainer.DevImage == "" { |
| 473 | return nil |
| 474 | } |
| 475 | |
| 476 | index, container, err := getPodTemplateContainer(ctx, devPod, devContainer, podTemplate) |
| 477 | if err != nil { |
| 478 | return err |
| 479 | } |
| 480 | |
| 481 | imageStr, err := runtimevar.NewRuntimeResolver(ctx.WorkingDir(), true).FillRuntimeVariablesAsString(ctx.Context(), devContainer.DevImage, ctx.Config(), ctx.Dependencies()) |
| 482 | if err != nil { |
| 483 | return err |
| 484 | } |
| 485 | |
| 486 | container.ReadinessProbe = nil |
| 487 | container.LivenessProbe = nil |
| 488 | container.StartupProbe = nil |
| 489 | container.Image = imageStr |
| 490 | podTemplate.Spec.Containers[index] = *container |
| 491 | return nil |
| 492 | } |
| 493 | |
| 494 | func hashImageSelector(ctx devspacecontext.Context, replacePod *latest.DevPod) (string, error) { |
| 495 | if replacePod.ImageSelector != "" { |
no test coverage detected