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 logic to apply ConsoleLink #268

Merged

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Jun 29, 2023

Description

Add logic to apply ConsoleLink when it is only for downstream cluster

Ref: red-hat-data-services/odh-manifests#426
#261

Depend on opendatahub-io/odh-manifests#891

How Has This Been Tested?

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci
Copy link

openshift-ci bot commented Jun 29, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@etirelli
Copy link
Contributor

@zdtsw since this manifest file is only creating a route, I think our intent was to replace it immediately by an API call to create the route and avoid the manifest file. Thoughts?

@zdtsw
Copy link
Member Author

zdtsw commented Jun 29, 2023

@zdtsw since this manifest file is only creating a route, I think our intent was to replace it immediately by an API call to create the route and avoid the manifest file. Thoughts?

you mean to not haveconsolelink.yamlat all?
.spec.applicationMenu.imageURL how this should be supplied to the API call?

@zdtsw
Copy link
Member Author

zdtsw commented Jul 6, 2023

/hold

@zdtsw zdtsw marked this pull request as ready for review July 25, 2023 13:53
@openshift-ci openshift-ci bot requested review from etirelli and LaVLaS July 25, 2023 13:53
@zdtsw zdtsw changed the title [WIP]: Add logic to apply ConsoleLink Add logic to apply ConsoleLink Jul 26, 2023
@zdtsw zdtsw requested review from VaishnaviHire and removed request for LaVLaS July 26, 2023 07:47
@@ -91,11 +92,18 @@ func (d *Dashboard) ReconcileComponent(owner metav1.Object, cli client.Client, s
if err != nil {
return fmt.Errorf("failed to set dashboard ISV from %s", PathISVAddOn)
}
// ConsoleLink handling
err = deploy.DeployManifestsFromPath(owner, cli, ComponentName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't we want to get url from dashboard route and update the ConsoleLink yaml first https://github.com/red-hat-data-services/odh-manifests/blob/feature-rearchitecture/odh-dashboard/consolelink/consolelink.yaml#L9 before applying it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange, the other file of generating replacement is not in this PR. must get lost in the old branch.
i will update it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this is the right way.
so i want to reuse ReplaceStringsInFile function to replace variable in manifests, and it is currently in dscinitialzation.utils, to avoid cycle import, i moved the function into pkg/common
in theory, these lines of get route, replace can be done in a function instead of inject in the function

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the RelaceStrings to common, is this ready to merge ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, think so.
it is using common.ReplaceStringsInFile()

PathISVCommon = deploy.DefaultManifestPath + "/" + ComponentName + "/overlays/apps"
PathISVSM = deploy.DefaultManifestPath + "/" + ComponentName + "/overlays/apps-onpre"
PathISVAddOn = deploy.DefaultManifestPath + "/" + ComponentName + "/overlays/apps-addon"
ComponentName = "odh-dashboard"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdtsw I think you need to rebase?

@zdtsw
Copy link
Member Author

zdtsw commented Jul 31, 2023

/unhold

- Move from util to common for ReplaceStringsInFile

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Copy link
Member

@VaishnaviHire VaishnaviHire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Jul 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: VaishnaviHire

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zdtsw zdtsw merged commit 9ca4404 into opendatahub-io:feature-rearchitecture Jul 31, 2023
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants