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

Add apply manifests for dashboard ISV #346

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
47 changes: 46 additions & 1 deletion components/dashboard/dashboard.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package dashboard

import (
"fmt"

"github.com/opendatahub-io/opendatahub-operator/v2/components"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/common"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/deploy"
Expand All @@ -12,6 +14,9 @@ import (
const (
ComponentName = "odh-dashboard"
Path = deploy.DefaultManifestPath + "/" + ComponentName + "/base"
PathISVCommon = deploy.DefaultManifestPath + "/" + ComponentName + "/overlays/apps"
PathISVSM = deploy.DefaultManifestPath + "/" + ComponentName + "/overlays/apps-onpre"
PathISVAddOn = deploy.DefaultManifestPath + "/" + ComponentName + "/overlays/apps-addon"
)

type Dashboard struct {
Expand Down Expand Up @@ -49,7 +54,47 @@ func (d *Dashboard) ReconcileComponent(owner metav1.Object, cli client.Client, s
Path,
namespace,
scheme, enabled)
return err
if err != nil {
return err
}

// ISV handling
switch platform {
case deploy.SelfManagedRhods:
err := deploy.DeployManifestsFromPath(owner, cli, ComponentName,
PathISVCommon,
namespace,
scheme, enabled)
if err != nil {
return fmt.Errorf("failed to set dashboard ISV from %s", PathISVCommon)
}
err = deploy.DeployManifestsFromPath(owner, cli, ComponentName,
PathISVSM,
namespace,
scheme, enabled)
if err != nil {
return fmt.Errorf("failed to set dashboard ISV from %s", PathISVSM)
}
return err
case deploy.ManagedRhods:
err := deploy.DeployManifestsFromPath(owner, cli, ComponentName,
PathISVCommon,
namespace,
scheme, enabled)
if err != nil {
return fmt.Errorf("failed to set dashboard ISV from %s", PathISVCommon)
}
err = deploy.DeployManifestsFromPath(owner, cli, ComponentName,
PathISVAddOn,
namespace,
scheme, enabled)
if err != nil {
return fmt.Errorf("failed to set dashboard ISV from %s", PathISVAddOn)
}
return err
default:
return nil
}

}

Expand Down