Skip to content

Commit

Permalink
Sync APIs. @tag-name=gloo-v1.13.25 (#950)
Browse files Browse the repository at this point in the history
Co-authored-by: soloio-bot <[email protected]>
  • Loading branch information
soloio-bot and soloio-bot authored Aug 16, 2023
1 parent 86a662e commit 69e00ca
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions api/gloo/gloo/external/solo/ratelimit/rate_limit_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (
skres "github.com/solo-io/solo-kit/pkg/api/v1/clients/kube/crd/solo.io/v1"
"github.com/solo-io/solo-kit/pkg/utils/protoutils"

types "github.com/solo-io/solo-apis/pkg/api/ratelimit.solo.io/v1alpha1"

"github.com/solo-io/solo-apis/pkg/api/ratelimit.solo.io/v1alpha1"

"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
Expand Down Expand Up @@ -87,19 +85,19 @@ func (r *RateLimitConfig) convertSoloKitStatusToRateLimitConfigStatus(status *co
return nil
}

var outputState types.RateLimitConfigStatus_State
var outputState v1alpha1.RateLimitConfigStatus_State
switch status.GetState() {
case core.Status_Pending:
outputState = types.RateLimitConfigStatus_PENDING
outputState = v1alpha1.RateLimitConfigStatus_PENDING
case core.Status_Accepted:
outputState = types.RateLimitConfigStatus_ACCEPTED
outputState = v1alpha1.RateLimitConfigStatus_ACCEPTED
case core.Status_Rejected:
outputState = types.RateLimitConfigStatus_REJECTED
outputState = v1alpha1.RateLimitConfigStatus_REJECTED
case core.Status_Warning:
// should never happen, RateLimitConfigs should never have any warnings on them because ratelimitconfigs use
// statuses generated by skv2
contextutils.LoggerFrom(context.Background()).DPanic("cannot set WARNING status on RateLimitConfig resources")
outputState = types.RateLimitConfigStatus_REJECTED
outputState = v1alpha1.RateLimitConfigStatus_REJECTED
}

return &v1alpha1.RateLimitConfigStatus{
Expand All @@ -116,11 +114,11 @@ func (r *RateLimitConfig) convertRateLimitConfigStatusToSoloKitStatus(status *v1

var outputState core.Status_State
switch status.GetState() {
case types.RateLimitConfigStatus_PENDING:
case v1alpha1.RateLimitConfigStatus_PENDING:
outputState = core.Status_Pending
case types.RateLimitConfigStatus_ACCEPTED:
case v1alpha1.RateLimitConfigStatus_ACCEPTED:
outputState = core.Status_Accepted
case types.RateLimitConfigStatus_REJECTED:
case v1alpha1.RateLimitConfigStatus_REJECTED:
outputState = core.Status_Rejected
}

Expand Down

0 comments on commit 69e00ca

Please sign in to comment.