From c282f37b3e82d6d63156534d0a13e90822205156 Mon Sep 17 00:00:00 2001 From: Gabriel Krenn Date: Thu, 28 Nov 2024 09:00:49 +0100 Subject: [PATCH] Allow custom version for cloudnative (#4110) Co-authored-by: Marcell Sevcsik <31651557+0sewa0@users.noreply.github.com> --- pkg/api/v1beta3/dynakube/oneagent_props.go | 4 ---- pkg/controllers/dynakube/version/updater.go | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/api/v1beta3/dynakube/oneagent_props.go b/pkg/api/v1beta3/dynakube/oneagent_props.go index ce8752faa6..e1471af4ce 100644 --- a/pkg/api/v1beta3/dynakube/oneagent_props.go +++ b/pkg/api/v1beta3/dynakube/oneagent_props.go @@ -163,10 +163,6 @@ func (dk *DynaKube) CustomCodeModulesImage() string { // CustomCodeModulesVersion provides the version for the CodeModules provided in the Spec. func (dk *DynaKube) CustomCodeModulesVersion() string { - if !dk.ApplicationMonitoringMode() { - return "" - } - return dk.CustomOneAgentVersion() } diff --git a/pkg/controllers/dynakube/version/updater.go b/pkg/controllers/dynakube/version/updater.go index 68804c5c6e..6b674ed690 100644 --- a/pkg/controllers/dynakube/version/updater.go +++ b/pkg/controllers/dynakube/version/updater.go @@ -40,10 +40,9 @@ func (r *reconciler) run(ctx context.Context, updater StatusUpdater) error { } }() - customImage := updater.CustomImage() - if customImage != "" { + if currentSource == status.CustomImageVersionSource { log.Info("updating version status according to custom image", "updater", updater.Name()) - setImageIDToCustomImage(updater.Target(), customImage) + setImageIDToCustomImage(updater.Target(), updater.CustomImage()) return nil }