Skip to content

Commit

Permalink
update: cleanup cache for deployment in model reg namespace
Browse files Browse the repository at this point in the history
- Operator does not need to cache deployment in this namespace
- it is up to model reg operator for resoruces created there

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
  • Loading branch information
zdtsw committed Oct 16, 2024
1 parent a5388ad commit aefa392
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 4 additions & 4 deletions components/modelregistry/modelregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ var (
ComponentName = "model-registry-operator"
DefaultModelRegistriesNamespace = "odh-model-registries"
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 @@ -127,6 +123,10 @@ func (m *ModelRegistry) ReconcileComponent(ctx context.Context, cli client.Clien
}

// Create model registries namespace
// we should not apply this label to the namespace, as it triggered namspace deletion during operator uninstall
// modelRegistryLabels = cluster.WithLabels(
// labels.ODH.OwnedNamespace, "true",
// ).
// We do not delete this namespace even when ModelRegistry is Removed or when operator is uninstalled.
ns, err := cluster.CreateNamespace(ctx, cli, m.RegistriesNamespace)
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import (
dscv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/datasciencecluster/v1"
dsciv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1"
featurev1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/features/v1"
"github.com/opendatahub-io/opendatahub-operator/v2/components/modelregistry"
"github.com/opendatahub-io/opendatahub-operator/v2/controllers/certconfigmapgenerator"
dscctrl "github.com/opendatahub-io/opendatahub-operator/v2/controllers/datasciencecluster"
dscictrl "github.com/opendatahub-io/opendatahub-operator/v2/controllers/dscinitialization"
Expand Down Expand Up @@ -388,7 +387,5 @@ func createDeploymentCacheConfig(platform cluster.Platform) map[string]cache.Con
default:
namespaceConfigs["opendatahub"] = cache.Config{}
}
// for modelregistry namespace
namespaceConfigs[modelregistry.DefaultModelRegistriesNamespace] = cache.Config{}
return namespaceConfigs
}

0 comments on commit aefa392

Please sign in to comment.