Skip to content

Commit

Permalink
modelregistry: partial: chore(lint): enable contextcheck and containe…
Browse files Browse the repository at this point in the history
…dctx (opendatahub-io#1070)

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <[email protected]>
Date:   Tue Jun 25 17:15:13 2024 +0200

    chore(lint): enable contextcheck and containedctx (opendatahub-io#1070)

    * chore(lint): enable contextcheck

    Signed-off-by: Luca Burgazzoli <[email protected]>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <[email protected]>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <[email protected]>

Signed-off-by: Yauheni Kaliuta <[email protected]>
  • Loading branch information
ykaliuta committed Aug 27, 2024
1 parent 32f59c6 commit 6d0e52d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/modelregistry/modelregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ type ModelRegistry struct {
components.Component `json:""`
}

func (m *ModelRegistry) OverrideManifests(_ string) error {
func (m *ModelRegistry) OverrideManifests(ctx context.Context, _ string) error {
// If devflags are set, update default manifests path
if len(m.DevFlags.Manifests) != 0 {
manifestConfig := m.DevFlags.Manifests[0]
if err := deploy.DownloadManifests(ComponentName, manifestConfig); err != nil {
if err := deploy.DownloadManifests(ctx, ComponentName, manifestConfig); err != nil {
return err
}
// If overlay is defined, update paths
Expand Down Expand Up @@ -71,7 +71,7 @@ func (m *ModelRegistry) ReconcileComponent(ctx context.Context, cli client.Clien
if enabled {
if m.DevFlags != nil {
// Download manifests and update paths
if err := m.OverrideManifests(string(platform)); err != nil {
if err := m.OverrideManifests(ctx, string(platform)); err != nil {
return err
}
}
Expand All @@ -91,13 +91,13 @@ func (m *ModelRegistry) ReconcileComponent(ctx context.Context, cli client.Clien
}
}
// Deploy ModelRegistry Operator
if err := deploy.DeployManifestsFromPath(cli, owner, Path, dscispec.ApplicationsNamespace, m.GetComponentName(), enabled); err != nil {
if err := deploy.DeployManifestsFromPath(ctx, cli, owner, Path, dscispec.ApplicationsNamespace, m.GetComponentName(), enabled); err != nil {
return err
}
l.Info("apply manifests done")

// Create additional model registry resources, componentEnabled=true because these extras are never deleted!
if err := deploy.DeployManifestsFromPath(cli, owner, Path+"/extras", dscispec.ApplicationsNamespace, m.GetComponentName(), true); err != nil {
if err := deploy.DeployManifestsFromPath(ctx, cli, owner, Path+"/extras", dscispec.ApplicationsNamespace, m.GetComponentName(), true); err != nil {
return err
}
l.Info("apply extra manifests done")
Expand Down

0 comments on commit 6d0e52d

Please sign in to comment.