Skip to content

Commit

Permalink
update: for ODH change consolelink location
Browse files Browse the repository at this point in the history
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
  • Loading branch information
zdtsw committed Jun 20, 2024
1 parent 54d600a commit 6775a22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/dashboard/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ var (

ComponentNameUpstream = "dashboard"
PathUpstream = deploy.DefaultManifestPath + "/" + ComponentNameUpstream + "/odh"
PathCommon = deploy.DefaultManifestPath + "/" + ComponentNameUpstream + "/common"
ConsoleLinkPathUpstream = PathCommon + "/consolelink"
PathCommon = deploy.DefaultManifestPath + "/" + ComponentNameUpstream + "/common"
ConsoleLinkPathUpstream = deploy.DefaultManifestPath + "/" + ComponentNameUpstream + "/overrides/consolelink"

ComponentNameDownstream = "rhods-dashboard"
PathDownstream = deploy.DefaultManifestPath + "/" + ComponentNameUpstream + "/rhoai"
Expand Down Expand Up @@ -249,7 +249,7 @@ func (d *Dashboard) configConsoleLink(ctx context.Context, cli client.Client, pl
routeName = "odh-dashboard"
}

pathConsoleLink := filepath.Join(manifestsPath, "consolelink.yaml")
fileConsoleLink := filepath.Join(manifestsPath, "consolelink.yaml")

consoleRoute := &routev1.Route{}
if err := cli.Get(ctx, client.ObjectKey{Name: ConsoleLinkName, Namespace: ConsoleLinkNS}, consoleRoute); err != nil {
Expand All @@ -258,7 +258,7 @@ func (d *Dashboard) configConsoleLink(ctx context.Context, cli client.Client, pl

domainIndex := strings.Index(consoleRoute.Spec.Host, ".")
consoleLinkDomain := consoleRoute.Spec.Host[domainIndex+1:]
if err := common.ReplaceStringsInFile(pathConsoleLink, map[string]string{
if err := common.ReplaceStringsInFile(fileConsoleLink, map[string]string{
"<dashboard-url>": "https://" + routeName + "-" + namespace + "." + consoleLinkDomain,
"<section-title>": sectionTitle,
}); err != nil {
Expand Down

0 comments on commit 6775a22

Please sign in to comment.