Skip to content

Commit

Permalink
Fix findings
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Feb 3, 2025
1 parent 9626a24 commit 16ad243
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ spec:
managementState: Managed
datasciencepipelines:
managementState: Managed
managedPipelines:
instructLab:
state: Managed
kserve:
managementState: Managed
nim:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
componentApi "github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1alpha1"
dscv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/datasciencecluster/v1"
"github.com/opendatahub-io/opendatahub-operator/v2/controllers/status"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/cluster"
cr "github.com/opendatahub-io/opendatahub-operator/v2/pkg/componentsregistry"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/deploy"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/metadata/annotations"
Expand All @@ -38,8 +39,14 @@ func (s *componentHandler) GetManagementState(dsc *dscv1.DataScienceCluster) ope
}

func (s *componentHandler) Init(_ common.Platform) error {
if err := deploy.ApplyParams(paramsPath, imageParamMap); err != nil {
return fmt.Errorf("failed to update images on path %s: %w", paramsPath, err)
release := cluster.GetRelease()

extraParams := map[string]string{
platformVersionParamsKey: release.Version.String(),
}

if err := deploy.ApplyParams(paramsPath, imageParamMap, extraParams); err != nil {
return fmt.Errorf("failed to apply params on path %s: %w", paramsPath, err)

Check warning on line 49 in controllers/components/datasciencepipelines/datasciencepipelines.go

View check run for this annotation

Codecov / codecov/patch

controllers/components/datasciencepipelines/datasciencepipelines.go#L42-L49

Added lines #L42 - L49 were not covered by tests
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func computeParamsMap(rr *types.ReconciliationRequest) (map[string]string, error

extraParamsMap := map[string]string{
managedPipelineParamsKey: string(data),
platformVersionParamsKey: rr.Release.Version.String(),
}

return extraParamsMap, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ func TestComputeParamsMap(t *testing.T) {

g.Expect(result).Should(And(
HaveKeyWithValue(managedPipelineParamsKey, string(expectedData)),
HaveKeyWithValue(platformVersionParamsKey, v.String()),
))
}

0 comments on commit 16ad243

Please sign in to comment.