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

Remove short-names for gateways with all-numeric Top Level Domains #164

Merged
merged 1 commit into from Sep 15, 2020

Conversation

shreejad
Copy link
Contributor

Fixes #7742 in Knative Serving

While exposing short-names for cluster local gateways, validate that the trimmed domain name does not have an all-numeric Top Level Domain.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Sep 15, 2020
@knative-prow-robot knative-prow-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 15, 2020
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-networking-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/ingress/ingress.go 92.5% 93.5% 1.0

@shreejad shreejad changed the title Remove invalid short-names for gateways with all-numeric Top Level Do… Remove short-names for gateways with all-numeric Top Level Domains Sep 15, 2020

// Validate that the Top Level Domain of a given hostname is not fully numeric.
// Example: '1234' is an invalid TLD
func isValidTopLevelDomain(domain string) bool {

Choose a reason for hiding this comment

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

We may want to check if there is any other invalid format. But it does not need to be included in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error being thrown was from this code I think - https://github.com/istio/istio/blob/eb63aae13235c98f99cea6591d4401c569576949/pkg/config/validation/validation.go#L170
There are a few more validation checks for the entire domain being done here, like the length, being compared to a wildcard domain etc. But if the base domain here is valid, for the trimmed domains to be invalid, only the TLD seemed relevant. But the assumption here is that we know that the base domain is valid, which I'm not sure of

@ZhiminXiang
Copy link

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2020
@ZhiminXiang
Copy link

/approve

@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shreejad, ZhiminXiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 15, 2020
@knative-prow-robot knative-prow-robot merged commit 348082e into knative:master Sep 15, 2020
vagababov added a commit to vagababov/networking that referenced this pull request Sep 15, 2020
Since I didn't have time to comment :/
knative-prow-robot pushed a commit that referenced this pull request Sep 15, 2020
* Some updates to the #164

Since I didn't have time to comment :/

* append
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ksvc fails to create VirtualService in all-numeric namespace
5 participants