From e505b7326daf77dd41ae37b58880cad61740a345 Mon Sep 17 00:00:00 2001 From: Andrew Gouin Date: Mon, 18 Sep 2023 12:46:22 -0600 Subject: [PATCH] Add image override --- api/v1/cosmosfullnode_types.go | 4 ++++ internal/fullnode/build_pods.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/api/v1/cosmosfullnode_types.go b/api/v1/cosmosfullnode_types.go index 7e200ac5..0294a2d6 100644 --- a/api/v1/cosmosfullnode_types.go +++ b/api/v1/cosmosfullnode_types.go @@ -696,6 +696,10 @@ type InstanceOverridesSpec struct { // Overrides an individual instance's PVC. // +optional VolumeClaimTemplate *PersistentVolumeClaimSpec `json:"volumeClaimTemplate"` + + // Overrides an individual instance's Image. + // +optional + Image string `json:"image"` } type DisableStrategy string diff --git a/internal/fullnode/build_pods.go b/internal/fullnode/build_pods.go index 6b2fd069..d7a2dca0 100644 --- a/internal/fullnode/build_pods.go +++ b/internal/fullnode/build_pods.go @@ -25,6 +25,9 @@ func BuildPods(crd *cosmosv1.CosmosFullNode, cksums ConfigChecksums) ([]diff.Res if disable := overrides[pod.Name].DisableStrategy; disable != nil { continue } + if image := overrides[pod.Name].Image; image != "" { + pod.Spec.Containers[0].Image = image + } if _, shouldSnapshot := candidates[pod.Name]; shouldSnapshot { continue }