Skip to content

Commit

Permalink
expect wildcard endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
maleck13 committed Mar 12, 2024
1 parent 5bfb02e commit 9214e66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions api/v1alpha1/dnsrecord_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,13 @@ func (s *DNSRecord) Validate() error {
return fmt.Errorf("invalid endpoint discovered %s all endpoints should be equal to or end with the rootHost %s", ep.DNSName, root)
}
if !rootEndpointFound {
if ep.DNSName == root {
//check original root
if ep.DNSName == *s.Spec.RootHost {
rootEndpointFound = true
}
}
}
if !rootEndpointFound && !s.isWildCardRoot() {
if !rootEndpointFound {
return fmt.Errorf("invalid endpoint set. rootHost is set but found no endpoint defining a record for the rootHost %s", root)
}
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/dnsrecord_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestValidate(t *testing.T) {
"a.example.com",
"b.example.com",
},
wantErr: false,
wantErr: true,
},
}

Expand Down

0 comments on commit 9214e66

Please sign in to comment.