-
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
start-build from-webhook: use canonical hostport to compare with config #10836
start-build from-webhook: use canonical hostport to compare with config #10836
Conversation
@@ -598,7 +599,7 @@ func (o *StartBuildOptions) RunStartBuildWebHook() error { | |||
config, err := o.ClientConfig.ClientConfig() | |||
if err == nil { | |||
if url, _, err := restclient.DefaultServerURL(config.Host, "", unversioned.GroupVersion{}, true); err == nil { | |||
if url.Host == hook.Host && url.Scheme == hook.Scheme { | |||
if netutil.CanonicalAddr(url) == netutil.CanonicalAddr(hook) && url.Scheme == hook.Scheme { |
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.
is it possible we were doing the direct Host comparison anywhere else in the cli?
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.
I was so proud of my simple fix, and you have to go and make it hard :) I'll take a look
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.
So the only other place I found was here:
https://github.com/openshift/origin/blob/master/pkg/cmd/cli/cmd/login/helpers.go#L28
https://github.com/openshift/origin/blob/master/pkg/cmd/cli/cmd/login/helpers.go#L40
However, I think the config is stored with the canonical address, so it may not be necessary to fix.
@fabianofranz do we have to worry about using the canonical address there?
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.
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.
thx @liggitt
lgtm, post 3.3. |
[merge] |
@csrwng this appears to have bit-rotted:
|
Will update shortly |
d1dfbdd
to
f03483a
Compare
updated package name |
[Test]ing while waiting on the merge queue |
Flake #9457 |
flake #11016 |
#11016 |
[merge] |
flake #11058 |
flake #8427 |
[merge] On Mon, Sep 26, 2016 at 8:27 PM, OpenShift Bot [email protected]
Ben Parees | OpenShift |
#10987 |
Evaluated for origin test up to f03483a |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9403/) |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9403/) (Image: devenv-rhel7_5093) |
[merge] On Wed, Sep 28, 2016 at 1:22 PM, OpenShift Bot [email protected]
Ben Parees | OpenShift |
Evaluated for origin merge up to f03483a |
Merged by openshift-bot
When deciding whether to use the transport from the client config, use a canonical host/port string to compare the webhook URL with the config address.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1373788