From cafd17dcdc0f82f1b725edca7e0bf30a4877edb0 Mon Sep 17 00:00:00 2001 From: Wen Zhou Date: Thu, 5 Oct 2023 09:46:05 +0200 Subject: [PATCH] Add check on the replace image on the component level overwrite (#583) Signed-off-by: Wen Zhou --- components/codeflare/codeflare.go | 2 +- components/dashboard/dashboard.go | 3 ++- components/datasciencepipelines/datasciencepipelines.go | 2 +- components/kserve/kserve.go | 4 ++-- components/modelmeshserving/modelmeshserving.go | 2 +- components/ray/ray.go | 2 +- components/workbenches/workbenches.go | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/codeflare/codeflare.go b/components/codeflare/codeflare.go index c6105416e84..d07ecbd70a7 100644 --- a/components/codeflare/codeflare.go +++ b/components/codeflare/codeflare.go @@ -84,7 +84,7 @@ func (c *CodeFlare) ReconcileComponent(cli client.Client, owner metav1.Object, d } // Update image parameters only when we do not have customized manifests set - if dscispec.DevFlags.ManifestsUri == "" { + if dscispec.DevFlags.ManifestsUri == "" && len(c.DevFlags.Manifests) == 0 { if err := deploy.ApplyImageParams(CodeflarePath, imageParamMap); err != nil { return err } diff --git a/components/dashboard/dashboard.go b/components/dashboard/dashboard.go index ff215842fba..486131f5e7e 100644 --- a/components/dashboard/dashboard.go +++ b/components/dashboard/dashboard.go @@ -119,7 +119,8 @@ func (d *Dashboard) ReconcileComponent(cli client.Client, owner metav1.Object, d } } - if dscispec.DevFlags.ManifestsUri == "" { + // Update image parameters (ODH does not use this solution, only downstream) + if dscispec.DevFlags.ManifestsUri == "" && len(d.DevFlags.Manifests) == 0 { if err := deploy.ApplyImageParams(PathSupported, imageParamMap); err != nil { return err } diff --git a/components/datasciencepipelines/datasciencepipelines.go b/components/datasciencepipelines/datasciencepipelines.go index 2e8f274e9e7..e539e03dfbe 100644 --- a/components/datasciencepipelines/datasciencepipelines.go +++ b/components/datasciencepipelines/datasciencepipelines.go @@ -74,7 +74,7 @@ func (d *DataSciencePipelines) ReconcileComponent(cli client.Client, owner metav // check if the dependent operator installed is done in dashboard // Update image parameters only when we do not have customized manifests set - if dscispec.DevFlags.ManifestsUri == "" { + if dscispec.DevFlags.ManifestsUri == "" && len(d.DevFlags.Manifests) == 0 { if err := deploy.ApplyImageParams(Path, imageParamMap); err != nil { return err } diff --git a/components/kserve/kserve.go b/components/kserve/kserve.go index 1408eff74da..a687be8ea85 100644 --- a/components/kserve/kserve.go +++ b/components/kserve/kserve.go @@ -113,7 +113,7 @@ func (k *Kserve) ReconcileComponent(cli client.Client, owner metav1.Object, dsci } // Update image parameters only when we do not have customized manifests set - if dscispec.DevFlags.ManifestsUri == "" { + if dscispec.DevFlags.ManifestsUri == "" && len(k.DevFlags.Manifests) == 0 { if err := deploy.ApplyImageParams(Path, imageParamMap); err != nil { return err } @@ -131,7 +131,7 @@ func (k *Kserve) ReconcileComponent(cli client.Client, owner metav1.Object, dsci return err } // Update image parameters for odh-maodel-controller - if dscispec.DevFlags.ManifestsUri == "" { + if dscispec.DevFlags.ManifestsUri == "" && len(k.DevFlags.Manifests) == 0 { if err := deploy.ApplyImageParams(DependentPath, dependentImageParamMap); err != nil { return err } diff --git a/components/modelmeshserving/modelmeshserving.go b/components/modelmeshserving/modelmeshserving.go index 0f5b18f72a8..7877a4d3d78 100644 --- a/components/modelmeshserving/modelmeshserving.go +++ b/components/modelmeshserving/modelmeshserving.go @@ -80,7 +80,7 @@ func (m *ModelMeshServing) ReconcileComponent(cli client.Client, owner metav1.Ob return err } // Update image parameters - if dscispec.DevFlags.ManifestsUri == "" { + if dscispec.DevFlags.ManifestsUri == "" && len(m.DevFlags.Manifests) == 0 { if err := deploy.ApplyImageParams(Path, imageParamMap); err != nil { return err } diff --git a/components/ray/ray.go b/components/ray/ray.go index 43f077a6bcf..01af1cf17ba 100644 --- a/components/ray/ray.go +++ b/components/ray/ray.go @@ -68,7 +68,7 @@ func (r *Ray) ReconcileComponent(cli client.Client, owner metav1.Object, dscispe return err } - if dscispec.DevFlags.ManifestsUri == "" { + if dscispec.DevFlags.ManifestsUri == "" || len(r.DevFlags.Manifests) == 0 { if err := deploy.ApplyImageParams(RayPath, imageParamMap); err != nil { return err } diff --git a/components/workbenches/workbenches.go b/components/workbenches/workbenches.go index a90fb3cd4a9..70b14aaa52e 100644 --- a/components/workbenches/workbenches.go +++ b/components/workbenches/workbenches.go @@ -135,7 +135,7 @@ func (w *Workbenches) ReconcileComponent(cli client.Client, owner metav1.Object, // Update image parameters for nbc in downstream if enabled { - if dscispec.DevFlags.ManifestsUri == "" { + if dscispec.DevFlags.ManifestsUri == "" && len(w.DevFlags.Manifests) == 0 { if platform == deploy.ManagedRhods || platform == deploy.SelfManagedRhods { if err := deploy.ApplyImageParams(notebookControllerPath, imageParamMap); err != nil { return err