mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-08-27 00:37:20 +00:00
fix(collector): fix dns collector limited to 63 chars (#1690)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user