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(collector): fix dns collector limited to 63 chars #1690

Merged
merged 4 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/collect/host_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func isValidLoadBalancerAddress(address string) bool {

}

errs := validation.IsQualifiedName(hostAddress)

// Checking for DNS name for RFC1123, DNS1123SubdomainMaxLength int = 253
errs := validation.IsDNS1123Subdomain(hostAddress)
return len(errs) == 0
}

Expand Down
7 changes: 6 additions & 1 deletion pkg/collect/host_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ func Test_isValidLoadBalancerAddress(t *testing.T) {
want: false,
},
{
name: "Too many characters",
name: "Valid long DNS domain but less than 255 characters, RFC1123 compliant",
args: args{address: "howlongcanwemakethiswithoutrunningoutofwordsbecasueweneedtohitatleast64.com:80"},
want: true,
},
{
name: "Non-valid long DNS domain but more than 255 characters, RFC1123 not compliant",
args: args{address: "howlongcanwemakethiswithouthowlongcanwemakethiswithouthowlongcanwemakethiswithoutrunningoutofwordsbecasueweneedtohitatleast64howlongcanwemakethiswithouthowlongcanwemakethiswithouthowlongcanwemakethiswithoutrunningoutofwordsbecasueweneedtohitatleast64dssdfasdffs.com:80"},
want: false,
},
{
Expand Down
Loading