Skip to content

Commit

Permalink
kserve: do not call ApplyParams for the empty list
Browse files Browse the repository at this point in the history
The call is not need since the code just declare empty parameters
list:
        var imageParamMap = map[string]string{}

Fixes the issue of calling ApplyParams for non-enabled case.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
  • Loading branch information
ykaliuta committed Aug 15, 2024
1 parent 4d3ed37 commit 41382ac
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions components/kserve/kserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ func (k *Kserve) GetComponentName() string {
func (k *Kserve) ReconcileComponent(ctx context.Context, cli client.Client,
logger logr.Logger, owner metav1.Object, dscispec *dsciv1.DSCInitializationSpec, platform cluster.Platform, _ bool) error {
l := k.ConfigComponentLogger(logger, ComponentName, dscispec)
// paramMap for Kserve to use.
var imageParamMap = map[string]string{}

// dependentParamMap for odh-model-controller to use.
var dependentParamMap = map[string]string{
Expand All @@ -125,13 +123,6 @@ func (k *Kserve) ReconcileComponent(ctx context.Context, cli client.Client,
}
}

// Update image parameters only when we do not have customized manifests set
if (dscispec.DevFlags == nil || dscispec.DevFlags.ManifestsUri == "") && (k.DevFlags == nil || len(k.DevFlags.Manifests) == 0) {
if err := deploy.ApplyParams(Path, imageParamMap, false); err != nil {
return fmt.Errorf("failed to update image from %s : %w", Path, err)
}
}

if err := k.configureServiceMesh(ctx, cli, dscispec); err != nil {
return fmt.Errorf("failed configuring service mesh while reconciling kserve component. cause: %w", err)
}
Expand Down

0 comments on commit 41382ac

Please sign in to comment.