-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 proxy for the webconsole #17862
add proxy for the webconsole #17862
Conversation
b9f8b33
to
a7165a9
Compare
config.GenericConfig.AuditBackend = genericConfig.AuditBackend | ||
config.GenericConfig.AuditPolicyChecker = genericConfig.AuditPolicyChecker | ||
assetServer, err := config.Complete().New(apiserver.EmptyDelegate) | ||
proxyHandler, err := NewServiceProxyHandler("webconsole", "openshift-web-console", aggregatorapiserver.NewClusterIPServiceResolver(c.ClientGoKubeInformers.Core().V1().Services().Lister()), caBundle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in-cluster service 👍
@@ -307,9 +303,6 @@ func (c *MasterConfig) withConsoleRedirection(handler, assetServerHandler http.H | |||
if assetConfig == nil { | |||
return handler | |||
} | |||
if !c.WebConsoleEnabled() || c.WebConsoleStandalone() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was it opt-in and is not anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was it opt-in and is not anymore?
Yeah. It's moving in 3.9. I don't think there's any plan to continue supporting the old path. They've even stopped pushing bindata updates.
|
||
// TODO this should properly handle content type negotiation | ||
// if the caller asked for protobuf and you write JSON bad things happen. | ||
func (r *responder) Object(statusCode int, obj runtime.Object) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this coming from? the responder of NewUpdateAwareHandler is a ErrorResponder
which only has the Error
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this coming from? the responder of NewUpdateAwareHandler is a ErrorResponder which only has the Error method.
Hmm.. Could be cruft. I copied from the aggregator which still had it. It's always hard to tell in golang. Is this function being used somewhere in the stack to cast as a particular kind of object and control behavior? Maybe. Worst language ever.
/retest |
I've verified that this works with #17575. |
// write a new location based on the existing request pointed at the target service | ||
location := &url.URL{} | ||
location.Scheme = "https" | ||
rloc, err := r.serviceResolver.ResolveEndpoint(r.serviceNamespace, r.serviceName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the resolution into a dialer in the rest client config so we only do a lookup when establishing a new connection, not on every http request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the resolution into a dialer in the rest client config so we only do a lookup when establishing a new connection, not on every http request
I think I'll do that as a follow on. This unblocks the majority of the work and is technically correct.
@spadgett Are there tests that make sure the console is accessible via this proxy?
a7165a9
to
dd05826
Compare
@@ -237,39 +237,3 @@ func TestAccessOriginWebConsoleMultipleIdentityProviders(t *testing.T) { | |||
tryAccessURL(t, url, exp.statusCode, exp.location, nil) | |||
} | |||
} | |||
|
|||
func TestAccessStandaloneOriginWebConsole(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this option no longer makes any sense
testserver "github.com/openshift/origin/test/util/server" | ||
) | ||
|
||
func TestWebConsoleExtensions(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spadgett you need to be sure you're testing this in the webconsole-server repo. Do you think you can port it yourself or do you need help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests need to be reworked anyway since we're changing how extensions load. I can look at it in web-console-server.
Automatic merge from submit-queue. Support web console image for cluster up https://trello.com/c/9oaUh8xP Install and run the web console server from a template during cluster up. Requires the proxy from #17862 to actually use the console server. @deads2k @jwforres
dd05826
to
f18a1a4
Compare
14178b5
to
53410d1
Compare
/retest |
53410d1
to
c1c520d
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest |
Automatic merge from submit-queue (batch tested with PRs 17914, 18021, 18022, 17862, 18043). |
Adds a proxy for the webconsole.
/assign @soltysh
/assign @liggitt
/assign @sttts
@jwforres @spadgett something for you to test against. When all the other parts are ready we can merge it.