Skip to content

Commit

Permalink
chore: Remove validation as covered by OpenAPI validation (#1132)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam committed Mar 26, 2024
1 parent 066cc4c commit bbddf9c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions pkg/apis/v1beta1/nodepool_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package v1beta1
import (
"context"
"fmt"
"regexp"

"github.com/robfig/cron/v3"
"github.com/samber/lo"
Expand Down Expand Up @@ -123,11 +122,5 @@ func (in *Budget) validate() (errs *apis.FieldError) {
return apis.ErrInvalidValue(in.Schedule, "schedule", fmt.Sprintf("invalid schedule %s", err))
}
}
if in.Duration != nil {
goodDuration, err := regexp.Match("^((([0-9]+(h|m))|([0-9]+h[0-9]+m))(0s)?)$", []byte(in.Duration.Duration.String()))
if err != nil || !goodDuration {
return apis.ErrInvalidValue(in.Schedule, "duration", fmt.Sprintf("invalid duration %s", err))
}
}
return errs
}

0 comments on commit bbddf9c

Please sign in to comment.