Skip to content

Commit

Permalink
Moved RegistriesNamespace to modelregistry component
Browse files Browse the repository at this point in the history
  • Loading branch information
Sara4994 committed Oct 28, 2024
1 parent 7dcd0e4 commit 12889bd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 46 deletions.
3 changes: 2 additions & 1 deletion components/modelregistry/modelregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ func (m *ModelRegistry) UpdateStatus(in *status.ComponentsStatus) {
modelRegistryStatus := status.GetReleaseVersion(deploy.DefaultManifestPath, ComponentName)

in.ModelRegistry = &status.ModelRegistryStatus{
ComponentStatus: modelRegistryStatus,
ComponentStatus: modelRegistryStatus,
RegistriesNamespace: m.RegistriesNamespace,
}
} else {
in.ModelRegistry = &status.ModelRegistryStatus{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -673,9 +670,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -692,9 +686,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -711,9 +702,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -730,9 +718,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -749,9 +734,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -770,9 +752,6 @@ spec:
type: string
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -789,9 +768,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -808,9 +784,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -827,9 +800,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand All @@ -846,9 +816,6 @@ spec:
properties:
releases:
items:
description: |-
Condition represents the state of the operator's
reconciliation functionality.
properties:
displayname:
type: string
Expand Down
10 changes: 0 additions & 10 deletions controllers/datasciencecluster/datasciencecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ 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/components/datasciencepipelines"
"github.com/opendatahub-io/opendatahub-operator/v2/components/modelregistry"
"github.com/opendatahub-io/opendatahub-operator/v2/controllers/status"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/cluster"
annotations "github.com/opendatahub-io/opendatahub-operator/v2/pkg/metadata/annotations"
Expand Down Expand Up @@ -344,15 +343,6 @@ func (r *DataScienceClusterReconciler) reconcileSubComponent(ctx context.Context
} else {
status.RemoveComponentCondition(&saved.Status.Conditions, componentName)
}

// TODO: replace this hack with a full refactor of component status in the future
if mr, isMR := component.(*modelregistry.ModelRegistry); isMR {
if enabled {
saved.Status.Components.ModelRegistry = &status.ModelRegistryStatus{RegistriesNamespace: mr.RegistriesNamespace}
} else {
saved.Status.Components.ModelRegistry = &status.ModelRegistryStatus{}
}
}
})
if err != nil {
instance = r.reportError(ctx, err, instance, "failed to update DataScienceCluster status after reconciling "+componentName)
Expand Down
4 changes: 2 additions & 2 deletions controllers/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ func RemoveComponentCondition(conditions *[]conditionsv1.Condition, component st
conditionsv1.RemoveStatusCondition(conditions, conditionsv1.ConditionType(component+ReadySuffix))
}

// Condition represents the state of the operator's
// reconciliation functionality.
// +k8s:deepcopy-gen=true
type ComponentReleaseStatus struct {
Name string `json:"name,omitempty"`
Expand Down Expand Up @@ -302,6 +300,8 @@ type ComponentsStatus struct {
Workbenches *WorkbenchesStatus `json:"workbenches,omitempty"`
}

// GetReleaseVersion read .env file and parse env variables delimiter by "=".
// If version is not set or set to "", return empty {}.
func GetReleaseVersion(defaultManifestPath string, componentName string) ComponentStatus {
var componentVersion semver.Version
var repositoryURL string
Expand Down

0 comments on commit 12889bd

Please sign in to comment.