Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
evyatarmeged committed Dec 11, 2024
1 parent cee9871 commit eb5982b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/operator/webhooks/clientintents_webhook_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (v *IntentsValidatorV1) validateSpec(intents *otterizev1beta1.ClientIntents
}
for _, dns := range intent.Internet.Domains {
_, err := idna.Lookup.ToASCII(dns)
if err != nil && !strings.Contains(dns, "*") {
if err != nil && !strings.HasPrefix(dns, "*") {
return &field.Error{
Type: field.ErrorTypeInvalid,
Field: "domains",
Expand Down
2 changes: 1 addition & 1 deletion src/operator/webhooks/clientintents_webhook_v1alpha3.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (v *IntentsValidatorV1alpha3) validateSpec(intents *otterizev1alpha3.Client
}
for _, dns := range intent.Internet.Domains {
_, err := idna.Lookup.ToASCII(dns)
if err != nil && !strings.Contains(dns, "*") {
if err != nil && !strings.HasPrefix(dns, "*") {
return &field.Error{
Type: field.ErrorTypeInvalid,
Field: "domains",
Expand Down
2 changes: 1 addition & 1 deletion src/operator/webhooks/clientintents_webhook_v2alpha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func (v *IntentsValidatorV2alpha1) validateInternetTarget(internetTarget *otteri
}
for _, dns := range internetTarget.Domains {
_, err := idna.Lookup.ToASCII(dns)
if err != nil && !strings.Contains(dns, "*") {
if err != nil && !strings.HasPrefix(dns, "*") {
return &field.Error{
Type: field.ErrorTypeInvalid,
Field: "domains",
Expand Down

0 comments on commit eb5982b

Please sign in to comment.