Skip to content

Commit

Permalink
Merge branch 'main' into jwt_support
Browse files Browse the repository at this point in the history
  • Loading branch information
JorTurFer authored Aug 18, 2021
2 parents 8c3c991 + df89ee2 commit d677f2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

### Improvements

- Improve validation in Cron scaler in case start & end input is same.([#2032](https://github.com/kedacore/keda/pull/2032))
- Add Bearer auth for Metrics API scaler ([#2028](https://github.com/kedacore/keda/pull/2028))

### Breaking Changes
Expand Down
3 changes: 3 additions & 0 deletions pkg/scalers/cron_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ func parseCronMetadata(config *ScalerConfig) (*cronMetadata, error) {
} else {
return nil, fmt.Errorf("no end schedule specified. %s", config.TriggerMetadata)
}
if meta.start == meta.end {
return nil, fmt.Errorf("error parsing schedule. %s: start and end can not have exactly same time input", config.TriggerMetadata)
}
if val, ok := config.TriggerMetadata["desiredReplicas"]; ok && val != "" {
metadataDesiredReplicas, err := strconv.Atoi(val)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/scalers/cron_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var testCronMetadata = []parseCronMetadataTestData{
{map[string]string{"timezone": "Asia/Kolkata", "start": "-30 * * * *", "end": "45 * * * *", "desiredReplicas": "10"}, true},
{map[string]string{"timezone": "Asia/Kolkata", "start": "30 * * * *", "end": "-50 * * * *", "desiredReplicas": "10"}, true},
{map[string]string{"timezone": "Asia/Kolkata", "start": "30 * * * *", "end": "50 * * -3 *", "desiredReplicas": "10"}, true},
{map[string]string{"timezone": "Asia/Kolkata", "start": "30 * * * *", "end": "30 * * * *", "desiredReplicas": "10"}, true},
}

var cronMetricIdentifiers = []cronMetricIdentifier{
Expand Down

0 comments on commit d677f2c

Please sign in to comment.