11package dashboard
22
33import (
4+ "fmt"
5+
46 "github.com/opendatahub-io/opendatahub-operator/v2/components"
57 "github.com/opendatahub-io/opendatahub-operator/v2/pkg/common"
68 "github.com/opendatahub-io/opendatahub-operator/v2/pkg/deploy"
@@ -12,6 +14,9 @@ import (
1214const (
1315 ComponentName = "odh-dashboard"
1416 Path = deploy .DefaultManifestPath + "/" + ComponentName + "/base"
17+ PathISVCommon = deploy .DefaultManifestPath + "/" + ComponentName + "/overlays/apps"
18+ PathISVSM = deploy .DefaultManifestPath + "/" + ComponentName + "/overlays/apps-onpre"
19+ PathISVAddOn = deploy .DefaultManifestPath + "/" + ComponentName + "/overlays/apps-addon"
1520)
1621
1722type Dashboard struct {
@@ -49,7 +54,47 @@ func (d *Dashboard) ReconcileComponent(owner metav1.Object, cli client.Client, s
4954 Path ,
5055 namespace ,
5156 scheme , enabled )
52- return err
57+ if err != nil {
58+ return err
59+ }
60+
61+ // ISV handling
62+ switch platform {
63+ case deploy .SelfManagedRhods :
64+ err := deploy .DeployManifestsFromPath (owner , cli , ComponentName ,
65+ PathISVCommon ,
66+ namespace ,
67+ scheme , enabled )
68+ if err != nil {
69+ return fmt .Errorf ("failed to set dashboard ISV from %s" , PathISVCommon )
70+ }
71+ err = deploy .DeployManifestsFromPath (owner , cli , ComponentName ,
72+ PathISVSM ,
73+ namespace ,
74+ scheme , enabled )
75+ if err != nil {
76+ return fmt .Errorf ("failed to set dashboard ISV from %s" , PathISVSM )
77+ }
78+ return err
79+ case deploy .ManagedRhods :
80+ err := deploy .DeployManifestsFromPath (owner , cli , ComponentName ,
81+ PathISVCommon ,
82+ namespace ,
83+ scheme , enabled )
84+ if err != nil {
85+ return fmt .Errorf ("failed to set dashboard ISV from %s" , PathISVCommon )
86+ }
87+ err = deploy .DeployManifestsFromPath (owner , cli , ComponentName ,
88+ PathISVAddOn ,
89+ namespace ,
90+ scheme , enabled )
91+ if err != nil {
92+ return fmt .Errorf ("failed to set dashboard ISV from %s" , PathISVAddOn )
93+ }
94+ return err
95+ default :
96+ return nil
97+ }
5398
5499}
55100
0 commit comments