Skip to content

Make the router handle ports properly (don't strip them). - #12580

Merged
openshift-bot merged 2 commits into
openshift:masterfrom
ramr:no-port-strip
Jan 21, 2017
Merged

Make the router handle ports properly (don't strip them).#12580
openshift-bot merged 2 commits into
openshift:masterfrom
ramr:no-port-strip

Conversation

@ramr

@ramr ramr commented Jan 20, 2017

Copy link
Copy Markdown
Contributor

@ramr

ramr commented Jan 20, 2017

Copy link
Copy Markdown
Contributor Author

[test]

@ramr

ramr commented Jan 20, 2017

Copy link
Copy Markdown
Contributor Author

[test]

@ramr

ramr commented Jan 20, 2017

Copy link
Copy Markdown
Contributor Author

@rajatchopra a quick review would be highly appreciated. Thx

@ramr ramr changed the title [WIP] Make the router handle ports properly (don't strip them). Make the router handle ports properly (don't strip them). Jan 20, 2017
@ramr

ramr commented Jan 20, 2017

Copy link
Copy Markdown
Contributor Author

@JacobTanenbaum if you could also give it a view that would be awesome.

@danwinship / @dcbw @knobunc is out today and I have been out sick all week but I got to finish this up - its for the trello card: https://trello.com/c/MEZZinj8/378-5-make-the-router-handle-ports-properly-don-t-strip-them
Ben mentioned to let you folks know and tag you for the review and mention that the work is approved to land. So if you could merge this once it gets past the reviews (or even review it), that would be greatly appreciated. Thanks a ton.

@ramr

ramr commented Jan 20, 2017

Copy link
Copy Markdown
Contributor Author

Error: FAILURE after 0.353s: test/end-to-end/core.sh:376: executing 'oc logs kubectl-with-token' expecting success and text 'Using in-cluster configuration': the output content test failed

Flake: #12558

@danwinship danwinship left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know haproxy configuration at all, so all I can really comment on is:

Comment thread pkg/router/template/router.go Outdated
}
}

return fmt.Sprintf("^%s(|:[0-9]+)%s(|/.*)$", hostRE, path)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't path be QuoteMeta()ed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Yes, it should be.

@ramr

ramr commented Jan 20, 2017

Copy link
Copy Markdown
Contributor Author

[test]

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 3a47229

@@ -102,6 +102,7 @@ func NewTemplatePlugin(cfg TemplatePluginConfig, lookupSvc ServiceLookup) (*Temp
"matchValues": matchValues, //compares a given string to a list of allowed strings

"genSubdomainWildcardRegexp": genSubdomainWildcardRegexp, //generates a regular expression matching the subdomain for hosts (and paths) with a wildcard policy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This function does not get used in the template now. Remove it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I put a comment on the actual function - we can but it would break any existing template - for example if you use a config map. So my 2 cents are to keep it around a bit and remove it later - that's just safer.

}

// genSubdomainWildcardRegexp is now legacy and around for backward
// compatibility and allows old templates to continue running.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I say remove it. Old templates with new router - how far will we go?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if you use config maps, you will run into issues once you upgrade/the latest image changes underneath you.

Comment thread pkg/router/template/router.go Outdated
}
}

return fmt.Sprintf("^%s(|:[0-9]+)%s(|/.*)$", hostRE, path)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we have a unit test to verify the behaviour of the regex? Just split this into a function and test that function's output only. Maybe a follow up PR.

@rajatchopra rajatchopra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@openshift-bot

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13112/) (Base Commit: 8492871)

@ramr

ramr commented Jan 20, 2017

Copy link
Copy Markdown
Contributor Author

Same flake: FAILURE after 0.216s: test/end-to-end/core.sh:376: executing 'oc logs kubectl-with-token' expecting success and text 'Using in-cluster configuration': the output content test failed

@ramr

ramr commented Jan 20, 2017

Copy link
Copy Markdown
Contributor Author

@rajatchopra @danwinship thanks for the quick reviews. Could one of you please hit merge. Thx.

@knobunc

knobunc commented Jan 21, 2017

Copy link
Copy Markdown
Contributor

[merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to 3a47229

@openshift-bot

openshift-bot commented Jan 21, 2017

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13133/) (Base Commit: 2cc89a9) (Image: devenv-rhel7_5744)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants