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 3 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: "Too many characters less than 255",
Copy link
Member

Choose a reason for hiding this comment

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

what is this testing for? The name needs to be really clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch. I have updated those test names

args: args{address: "howlongcanwemakethiswithoutrunningoutofwordsbecasueweneedtohitatleast64.com:80"},
want: true,
},
{
name: "Too many characters bigger than 255",
Copy link
Member

Choose a reason for hiding this comment

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

let's name this something more clear for what we're testing

args: args{address: "howlongcanwemakethiswithouthowlongcanwemakethiswithouthowlongcanwemakethiswithoutrunningoutofwordsbecasueweneedtohitatleast64howlongcanwemakethiswithouthowlongcanwemakethiswithouthowlongcanwemakethiswithoutrunningoutofwordsbecasueweneedtohitatleast64dssdfasdffs.com:80"},
want: false,
},
{
Expand Down
Loading