Skip to content

Commit

Permalink
Add check on the replace image on the component level overwrite (open…
Browse files Browse the repository at this point in the history
…datahub-io#583)

Signed-off-by: Wen Zhou <[email protected]>
  • Loading branch information
zdtsw authored Oct 5, 2023
1 parent 8d80553 commit cafd17d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/codeflare/codeflare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion components/dashboard/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion components/datasciencepipelines/datasciencepipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions components/kserve/kserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion components/modelmeshserving/modelmeshserving.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion components/ray/ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion components/workbenches/workbenches.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cafd17d

Please sign in to comment.