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

OCPBUGS-33787: add console and download URLs to console operator config #1887

Merged

Conversation

alebedev87
Copy link
Contributor

@alebedev87 alebedev87 commented May 10, 2024

This PR adds new fields to the console operator configuration: consoleURL, clientDownloadsURL. They allow the user to set an alternative console and client download base addresses (routes being the default). This API aims at helping to tolerate the absence of ingress capability on HyperShift managed clusters.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 10, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 10, 2024

@alebedev87: This pull request references NE-1319 which is a valid jira issue.

In response to this:

This PR adds a new field to the console configuration: ingress.consoleURL. This allows the user to set an alternative console base address. This API aims at helping to tolerate the absence of ingress capability on HyperShift managed clusters.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

openshift-ci bot commented May 10, 2024

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

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 10, 2024
Copy link
Contributor

openshift-ci bot commented May 10, 2024

Hello @alebedev87! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 10, 2024
@alebedev87 alebedev87 force-pushed the console-base-address branch 2 times, most recently from 4e55540 to 94ed45c Compare May 13, 2024 12:28
@alebedev87 alebedev87 marked this pull request as ready for review May 13, 2024 12:28
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2024
@alebedev87 alebedev87 changed the title NE-1319: add console URL to console config NE-1319: add console URL to console operator config May 13, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 13, 2024

@alebedev87: This pull request references NE-1319 which is a valid jira issue.

In response to this:

This PR adds a new field to the console operator configuration: consoleURL. This allows the user to set an alternative console base address. This API aims at helping to tolerate the absence of ingress capability on HyperShift managed clusters.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@alebedev87 alebedev87 force-pushed the console-base-address branch 2 times, most recently from f6dda12 to b48b8c8 Compare May 13, 2024 13:34
Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

The change looks good 👍 Adding a small nit.
@spadgett thoughts ?

operator/v1/types_console.go Outdated Show resolved Hide resolved
@alebedev87 alebedev87 force-pushed the console-base-address branch 2 times, most recently from 7873d5a to cf9aa50 Compare May 13, 2024 15:00
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 13, 2024

@alebedev87: This pull request references NE-1319 which is a valid jira issue.

In response to this:

This PR adds a new field to the console operator configuration: consoleURL. This allows the user to set an alternative console base address (console route being the default). This API aims at helping to tolerate the absence of ingress capability on HyperShift managed clusters.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@alebedev87
Copy link
Contributor Author

alebedev87 commented May 13, 2024

All the latest commits were to fix verify and integration jobs.

@@ -146,6 +146,14 @@ type ConsoleCustomization struct {
// +listMapKey=id
// +optional
Perspectives []Perspective `json:"perspectives"`
// consoleURL is an URL to be used as the base console address.
// If not specified, the console route hostname will be used.
// This is required when using console on clusters where the ingress capability is disabled.
Copy link
Member

Choose a reason for hiding this comment

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

What happens when you try to use this value when ingress is not disabled?

Copy link
Member

Choose a reason for hiding this comment

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

That part should be programatically conditioned by the console-operator

Copy link
Member

Choose a reason for hiding this comment

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

OK, but what does the operator do? Is the value ignored?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only use case for the moment is when the ingress is disabled. The comment needs to be updated to highlight this. I think the implementation may be expanded in the future as use cases come up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Field comment updated.

@alebedev87 alebedev87 force-pushed the console-base-address branch 3 times, most recently from ecb5e19 to c06c91d Compare May 14, 2024 14:05
@alebedev87
Copy link
Contributor Author

Field for the download ingress is added.

@alebedev87
Copy link
Contributor Author

alebedev87 commented May 14, 2024

/retitle NE-1319: add console and download URLs to console operator config

@openshift-ci-robot
Copy link

@alebedev87: This pull request references Jira Issue OCPBUGS-33787, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.17.0) matches configured target version for branch (4.17.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from yapei May 21, 2024 08:03
@alebedev87 alebedev87 force-pushed the console-base-address branch 2 times, most recently from 9b54a66 to 6b44a2b Compare May 21, 2024 12:19
// +kubebuilder:validation:XValidation:rule="isURL(self)",message="console url must be a valid absolute URL"
// +kubebuilder:validation:XValidation:rule="url(self).getScheme() == 'https'",message="console url scheme must be https"
// +kubebuilder:validation:MaxLength=1024
ConsoleURL string `json:"consoleURL,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Since these two URLs (and the object itself) are part of a config API, we tend to prefer to get rid of the omitempty.

If you were to do that, you would have to prefix the CEL to avoid running the validation when the string has length 0.

Can you give this a go?

The benefit here is that there's improved visibility and end users will see the fields in the rendered config as empty values, so they can see that the option exists and maybe then want to populate it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The benefit here is that there's improved visibility and end users will see the fields in the rendered config as empty values, so they can see that the option exists and maybe then want to populate it

What's wrong with the good old oc explain?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sometimes a user may have to go through several levels of oc explain to understand what options are available. Printing the whole struct out in configuration APIs makes it clear that there are levels below what they might see that they had no idea they might even want to oc explain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't this look a little misleading? When the CEL validation wants the value to be an URL but the user sees an empty string because they omitted the field.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would argue that users seeing an empty URL as allowed would indicate that this is an empty value that means nothing is going to happen no? It's only required to be a URL when it's length is non-zero I think is a reasonable validation no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, including spec.ingress.

// This field is required for clusters without ingress capability,
// where access to routes is not possible.
// Make sure that appropriate ingress is set up at this URL before assigning the value,
// otherwise the console operator may go degraded.
Copy link
Member

Choose a reason for hiding this comment

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

Feels like there's tension between being required for clusters without Ingress (with no timing notes) and needing a functional target. I understand that the console operator wants a functional consoleURL. And that when Ingress is enabled, it can provide that default console URL itself. But if you're in a cluster without Ingress, you probably want to set consoleURL to point at where you expect the console to be (as soon as you know where that is), without worrying about delaying until you know it's working, right? That way the console operator can check whether it's working for you, and let you know if you have more work to do. Can we reword this (and the similar clientDownloadsURL wording) to something like:

.... This field is required for clusters without Ingress capability, where access to Routes is not possible. The console operator will monitor the target and may set its ClusterOperator Degraded=True if the target is unreachable for sufficiently long to represent a lower quality of service.

which lifts some "lower quality of service" wording from the Degraded Godocs. Alternatively, just leave it implicit that the console operator is on top of this, and stop after "where access to routes is not possible."?

Copy link
Member

Choose a reason for hiding this comment

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

I see some discussion of this wording around here (sorry, I hadn't gone through Outdated but still unresolved threads before posting 😅), so feel free to ignore if I'm just missing context that's already been hashed out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But if you're in a cluster without Ingress, you probably want to set consoleURL to point at where you expect the console to be (as soon as you know where that is), without worrying about delaying until you know it's working, right? That way the console operator can check whether it's working for you, and let you know if you have more work to do

Good point. Indeed, the admin cannot be sure the URL is working until it gives the custom URL to the console operator. Since the operator has to update the internal and public configs before the full flow can work. Let me think of how I can reflect this in the description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rephrased to:

    // consoleURL is a URL to be used as the base console address.
    // If not specified, the console route hostname will be used.
    // This field is required for clusters without ingress capability,
    // where access to routes is not possible.
    // Make sure that appropriate ingress is set up at this URL.
    // The console operator will monitor the URL and may go degraded
    // if it's unreachable for an extended period.                                                                                    
    // Must use the HTTPS scheme.

Copy link
Member

Choose a reason for hiding this comment

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

I don't have the ability to mark this thread resolved myself, but the c0622aa Godocs look good to me 🙇

@alebedev87
Copy link
Contributor Author

/test verify-client-go

@alebedev87
Copy link
Contributor Author

Rebased from master. Should this fix verify-client-go job?

@jhadvig
Copy link
Member

jhadvig commented May 22, 2024

@alebedev87 whats the golang version on your machine ?

@JoelSpeed
Copy link
Contributor

Working on client-go issue separately, it's not a PR issue

@alebedev87
Copy link
Contributor Author

omitempty removed from all the new fields. clientDownloadsURL description updated to match consoleURL.

@alebedev87
Copy link
Contributor Author

/test verify-client-go

openshift/release#52368

Copy link
Member

@jhadvig jhadvig 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 openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 23, 2024
Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

openshift-ci bot commented May 24, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alebedev87, jhadvig, JoelSpeed

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 24, 2024
Copy link
Contributor

openshift-ci bot commented May 24, 2024

@alebedev87: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit d899f88 into openshift:master May 24, 2024
9 checks passed
@openshift-ci-robot
Copy link

@alebedev87: Jira Issue OCPBUGS-33787: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-33787 has not been moved to the MODIFIED state.

In response to this:

This PR adds new fields to the console operator configuration: consoleURL, clientDownloadsURL. They allow the user to set an alternative console and client download base addresses (routes being the default). This API aims at helping to tolerate the absence of ingress capability on HyperShift managed clusters.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-cluster-config-api-container-v4.17.0-202405242112.p0.gd899f88.assembly.stream.el9 for distgit ose-cluster-config-api.
All builds following this will include this PR.

@alebedev87
Copy link
Contributor Author

/cherry-pick release-4.16

@openshift-cherrypick-robot

@alebedev87: new pull request created: #1915

In response to this:

/cherry-pick release-4.16

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants