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

Add host_header annotation for Services #597

Merged
merged 3 commits into from
Apr 14, 2020
Merged

Conversation

rainest
Copy link
Contributor

@rainest rainest commented Apr 11, 2020

What this PR does / why we need it:
Add a konghq.com/host-header annotation for Services. The annotation sets the host_header parameter on the upstream associated with the Service, similar to the equivalent KongIngress setting added in bc506ef.

Special notes for your reviewer:
I forgot documentation for regex-priority and held off adding it for this one. Currently next does not have the fixes from 36474a5, and adding new docs would probably create conflicts. Do you have a standard process for rebasing next off master, or does it make more sense to just cherry-pick it?

Add a "konghq.com/host-header" annotation for Services. The annotation
sets the "host_header" parameter on the upstream associated with the
Service, similar to the equivalent KongIngress setting added in
bc506ef.

Split overrideUpstream logic into separate overrideUpstreamByAnnotation
and overrideUpstreamByKongIngress functions called by overrideUpstream.
Travis Raines added 2 commits April 13, 2020 14:37
* Move name copy inside overrideUpstreamByKongIngress
* Copy entire KongIngress upstream at once rather than piecemeal
* Correct erroneous comment
@@ -179,7 +180,12 @@ func HasServiceUpstreamAnnotation(anns map[string]string) bool {
return anns["ingress.kubernetes.io/service-upstream"] == "true"
}

// ExtractRegexPriority extracts the regex-priority annotation value.
// ExtractRegexPriority extracts the host-header annotation value.
Copy link
Member

Choose a reason for hiding this comment

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

You flipped the godoc in the two methods.

@hbagdi hbagdi merged commit ec7af67 into next Apr 14, 2020
@hbagdi hbagdi deleted the feat/upstream-host-annotation branch April 14, 2020 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants