Skip to content

Commit

Permalink
support invalid limits configmap
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Oct 13, 2022
1 parent 9a9a293 commit 6fc127c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/limitador_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ func mutateLimitsConfigMap(existingObj, desiredObj client.Object) (bool, error)
var existingLimits []limitadorv1alpha1.RateLimit
err = yaml.Unmarshal([]byte(existing.Data[limitador.LimitadorConfigFileName]), &existingLimits)
if err != nil {
return false, err
// if existing content cannot be parsed, leave existingLimits as nil, so the operator will
// enforce desired content.
existingLimits = nil
}

// TODO(eastizle): deepEqual returns false when the order in the list is not equal.
Expand Down

0 comments on commit 6fc127c

Please sign in to comment.