Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mr): create namespace for Model Registry #930

Merged
merged 6 commits into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions components/modelregistry/modelregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ import (

dsciv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1"
"github.com/opendatahub-io/opendatahub-operator/v2/components"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/cluster"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/deploy"
)

var (
ComponentName = "model-registry-operator"
Path = deploy.DefaultManifestPath + "/" + ComponentName + "/overlays/odh"
// we should not apply this label to the namespace, as it triggered namspace deletion during operator uninstall
// modelRegistryLabels = cluster.WithLabels(
// labels.ODH.OwnedNamespace, "true",
// ).
)

// Verifies that ModelRegistry implements ComponentInterface.
Expand Down Expand Up @@ -82,6 +87,13 @@ func (m *ModelRegistry) ReconcileComponent(_ context.Context, cli client.Client,
return fmt.Errorf("failed to update image from %s : %w", Path, err)
}
}

// Create odh-model-registries namespace
// We do not delete this namespace even when ModelRegistry is Removed or when operator is uninstalled.
_, err := cluster.CreateNamespace(cli, "odh-model-registries")
if err != nil {
return err
}
}
// Deploy ModelRegistry Operator
err = deploy.DeployManifestsFromPath(cli, owner, Path, dscispec.ApplicationsNamespace, m.GetComponentName(), enabled)
Expand Down
Loading