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

Fix alt-host generation when hostname has a partial overlap with cluster domain #35691

Merged
merged 6 commits into from Nov 8, 2021

Conversation

howardjohn
Copy link
Member

For example, a service foo.bar.local behaves incorrectly because we
incorrectly match the .local up with .cluster.local

Fixes #35676

@howardjohn howardjohn added the do-not-merge/hold Block automatic merging of a PR. label Oct 20, 2021
@howardjohn howardjohn requested a review from a team as a code owner October 20, 2021 17:36
@google-cla google-cla bot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Oct 20, 2021
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 20, 2021
@@ -622,5 +623,13 @@ func getUniqueAndSharedDNSDomain(fqdnHostname, proxyDomain string) (partsUnique
partsUnique = reverseArray(partsFQDNInReverse[len(sharedSuffixesInReverse):])
partsShared = reverseArray(sharedSuffixesInReverse)
}
if strings.Contains(proxyDomain, ".svc.") {
Copy link
Member Author

Choose a reason for hiding this comment

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

I implemented 2 fixes, I think both are not great. Left both to see what others thought, and put a hold for now.

The alternative is to have entirely different logic for k8s, (line499), which I think is better although the code could be cleaned up..

Copy link
Member Author

Choose a reason for hiding this comment

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

@ramaraochavali lmk what you think

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry. I missed this. It seems having entirely different logic for k8s is much cleaner

@ramaraochavali
Copy link
Contributor

Sorry missed this noitification

…ter domain

For example, a service `foo.bar.local` behaves incorrectly because we
incorrectly match the `.local` up with `.cluster.local`
}

testFn := func(service *model.Service, port int, node *model.Proxy, want []string) error {
out, _ := generateVirtualHostDomains(service, port, node)
sort.SliceStable(want, func(i, j int) bool { return want[i] < want[j] })
Copy link
Member Author

Choose a reason for hiding this comment

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

remove sort to make sure I didn't change the order. we should be conscious of changing the order.

@howardjohn howardjohn requested review from a team as code owners November 4, 2021 17:33
@howardjohn
Copy link
Member Author

/retest

@howardjohn howardjohn removed the do-not-merge/hold Block automatic merging of a PR. label Nov 5, 2021
@howardjohn
Copy link
Member Author

howardjohn commented Nov 8, 2021 via email

@istio-testing istio-testing merged commit 8085f1a into istio:master Nov 8, 2021
@fams
Copy link

fams commented Feb 18, 2022

We're experiencing this issue in istio 1.11.7. Is it will be fixed in 1.11.x or 1.12.x? I saw a fix in 1.13.0 release notes only

@howardjohn
Copy link
Member Author

This is currently only fixed in 1.13.0+

@fams
Copy link

fams commented Feb 18, 2022

Yes, I saw this. My question is: Do you guys have plans to fix this issue in 1.11.X? This release is still in maintenance, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong routes rendering in relation to clusterDomain
5 participants