-
Notifications
You must be signed in to change notification settings - Fork 88
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
Use errors middleware to redirect on idled workspace after 4 seconds #1392
Conversation
Skipping CI for Draft Pull Request. |
e83a46c
to
89698d4
Compare
Codecov Report
@@ Coverage Diff @@
## main #1392 +/- ##
==========================================
+ Coverage 63.12% 63.18% +0.05%
==========================================
Files 70 70
Lines 5804 5834 +30
==========================================
+ Hits 3664 3686 +22
- Misses 1777 1785 +8
Partials 363 363
Continue to review full report at Codecov.
|
89698d4
to
37955dd
Compare
I was wondering if we should redirect to the workspace page in dashboard instead of the home page. |
The workspace page is On the Traeffik side with the Traeffik errors middleware, the content after the To support redirection to the workspaces page, I think we would need to make some changes where the dashboard server receives the HTTP request. |
There is a bug somewhere in this implementation. When restarting an idled workspace, instead of opening the IDE, I'm redirected to the dashboard. I am investigating EDIT: the latest commit (3f85fd3) fixes this issue |
3f85fd3
to
f31939b
Compare
c956fe1
to
c130e99
Compare
This PR is ready to review. This PR adds two middlewares (errors and headers) to the workspace Traefik config: Here is an example config diff reflecting what this PR adds: middlewares:
workspace27366e668ca645c9-auth:
forwardAuth:
address: http://127.0.0.1:8089?namespace=admin-che
trustForwardHeader: false
+ workspace27366e668ca645c9-errors:
+ errors:
+ query: /
+ service: che-dashboard
+ status: 500-599
+ workspace27366e668ca645c9-headers:
+ headers:
+ customResponseHeaders:
+ cache-control: no-store, max-age=0
workspace27366e668ca645c9-strip-prefix:
stripPrefix:
prefixes:
- /workspace27366e668ca645c9
routers:
workspace27366e668ca645c9:
middlewares:
- workspace27366e668ca645c9-strip-prefix
- workspace27366e668ca645c9-auth
+ - workspace27366e668ca645c9-headers
+ - workspace27366e668ca645c9-errors
priority: 100
rule: PathPrefix(`/workspace27366e668ca645c9`)
service: workspace27366e668ca645c9
workspace27366e668ca645c9-3100-healthz:
middlewares:
- workspace27366e668ca645c9-strip-prefix
priority: 101
rule: Path(`/workspace27366e668ca645c9/theia-ide/3100/healthz`)
service: workspace27366e668ca645c9
+ serversTransports:
+ workspace27366e668ca645c9:
+ forwardingTimeouts:
+ dialTimeout: 4s
services:
workspace27366e668ca645c9:
loadBalancer:
servers:
- url: http://workspace27366e668ca645c9-service.admin-che.svc:3030
serversTransport: workspace27366e668ca645c9 The The serverTransport config was added to add a 4 second timeout for when trying to access the workspace url. If the workspace server cannot be reached after 4 seconds, then, the |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dkwon17, ibuziuk, tolusha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: David Kwon <[email protected]>
c130e99
to
67182b0
Compare
New changes are detected. LGTM label has been removed. |
/retest |
Signed-off-by: David Kwon <[email protected]>
67182b0
to
ef96f57
Compare
@dkwon17: The following test failed, say
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/test-infra repository. I understand the commands that are listed here. |
/retest |
@dkwon17 |
Thank you @tolusha , will merge |
Signed-off-by: David Kwon [email protected]
What does this PR do?
Alternative PR to #1386. The main difference is that this PR uses the Errors Traefik middleware.
Screenshot/screencast of this PR
In this gif we see that:
What issues does this PR fix or reference?
Part of eclipse-che/che#20599. In another PR, maybe we can redirect the user to some error page provided by the dashboard.
How to test this PR?
Tested on CRC with the following:
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.