diff --git a/install/init/crds-v1.yaml b/install/init/crds-v1.yaml index daaca21c..b0543ca2 100644 --- a/install/init/crds-v1.yaml +++ b/install/init/crds-v1.yaml @@ -679,7 +679,7 @@ spec: inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years' - format: int64 + format: int32 type: integer type: object quota: diff --git a/staging/src/slime.io/slime/modules/limiter/api/v1alpha2/smart_limiter.pb.go b/staging/src/slime.io/slime/modules/limiter/api/v1alpha2/smart_limiter.pb.go index bf9fd755..61c3658b 100644 --- a/staging/src/slime.io/slime/modules/limiter/api/v1alpha2/smart_limiter.pb.go +++ b/staging/src/slime.io/slime/modules/limiter/api/v1alpha2/smart_limiter.pb.go @@ -458,7 +458,7 @@ type Duration struct { // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` + Seconds int32 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` // Signed fractions of a second at nanosecond resolution of the span // of time. Durations less than one second are represented with a 0 // `seconds` field and a positive or negative `nanos` field. For durations @@ -495,7 +495,7 @@ func (m *Duration) XXX_DiscardUnknown() { var xxx_messageInfo_Duration proto.InternalMessageInfo -func (m *Duration) GetSeconds() int64 { +func (m *Duration) GetSeconds() int32 { if m != nil { return m.Seconds } @@ -684,11 +684,11 @@ var fileDescriptor_452a0625a4f6276b = []byte{ 0x12, 0xff, 0xb5, 0xdb, 0xac, 0x44, 0x5d, 0x35, 0x85, 0x43, 0x4f, 0xf1, 0x46, 0x3e, 0x49, 0x92, 0x89, 0x82, 0xbb, 0x6b, 0x47, 0x08, 0xfb, 0x19, 0x20, 0xa9, 0xb7, 0x7e, 0x32, 0x7f, 0xb5, 0x75, 0xab, 0x85, 0x0d, 0xb2, 0xc9, 0x09, 0xec, 0x55, 0x8f, 0xb7, 0x5f, 0x52, 0x8d, 0x76, 0x6a, 0x68, - 0x92, 0xb6, 0x1d, 0x56, 0x5b, 0x2b, 0x79, 0xce, 0x73, 0xe9, 0x3e, 0xf8, 0xdd, 0xd0, 0x6d, 0x26, + 0x92, 0xb6, 0x1b, 0x56, 0x5b, 0x2b, 0x79, 0xce, 0x73, 0xe9, 0x3e, 0xf8, 0xdd, 0xd0, 0x6d, 0x26, 0x09, 0xf4, 0x5c, 0xab, 0xd9, 0xf1, 0x93, 0x08, 0x85, 0x71, 0x73, 0xfc, 0xd4, 0x80, 0x6d, 0x96, 0x42, 0x2a, 0xe3, 0x2f, 0xd3, 0xda, 0x32, 0x2a, 0x59, 0x1a, 0xa4, 0xc1, 0xd1, 0x0f, 0xdd, 0xa6, 0xfe, 0x62, 0x77, 0x08, 0xa4, 0xf5, 0xe4, 0x73, 0xe8, 0x39, 0xb5, 0x36, 0x9d, 0x94, 0xdf, 0x3c, 0xfa, 0xe5, 0xa1, 0xd3, 0x46, 0xc8, 0x19, 0x2d, 0xdc, 0xef, 0x83, 0x4c, 0x26, 0x65, 0x8a, 0x7a, 0xe6, 0x55, 0x9a, 0xf1, 0x42, 0xcc, 0x2a, 0xa5, 0x7e, 0xeb, 0xd1, 0xff, 0xac, 0x47, 0xff, 0x05, - 0x00, 0x00, 0xff, 0xff, 0x3e, 0x0b, 0x67, 0xa7, 0x7e, 0x09, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xb4, 0xe1, 0xd4, 0x44, 0x7e, 0x09, 0x00, 0x00, } diff --git a/staging/src/slime.io/slime/modules/limiter/api/v1alpha2/smart_limiter.proto b/staging/src/slime.io/slime/modules/limiter/api/v1alpha2/smart_limiter.proto index 88b97e8e..5d1d0f12 100644 --- a/staging/src/slime.io/slime/modules/limiter/api/v1alpha2/smart_limiter.proto +++ b/staging/src/slime.io/slime/modules/limiter/api/v1alpha2/smart_limiter.proto @@ -159,7 +159,7 @@ message Duration { // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - int64 seconds = 1; + int32 seconds = 1; // Signed fractions of a second at nanosecond resolution of the span // of time. Durations less than one second are represented with a 0 diff --git a/staging/src/slime.io/slime/modules/limiter/controllers/envoy_local_limit.go b/staging/src/slime.io/slime/modules/limiter/controllers/envoy_local_limit.go index 231c4542..0a2b253f 100644 --- a/staging/src/slime.io/slime/modules/limiter/controllers/envoy_local_limit.go +++ b/staging/src/slime.io/slime/modules/limiter/controllers/envoy_local_limit.go @@ -438,7 +438,7 @@ func generateTokenBucket(item *microservicev1alpha2.SmartLimitDescriptor) *envoy return &envoy_type_v3.TokenBucket{ MaxTokens: uint32(i), FillInterval: &duration.Duration{ - Seconds: item.Action.FillInterval.Seconds, + Seconds: int64(item.Action.FillInterval.Seconds), Nanos: item.Action.FillInterval.Nanos, }, TokensPerFill: &wrappers.UInt32Value{Value: uint32(i)}, @@ -504,7 +504,8 @@ func generateEnvoyLocalRateLimitEnabled() *envoy_core_v3.RuntimeFractionalPercen } } -// % of requests that will enforce the local rate limit decision for a given route_key specified in the local rate limit configuration. +// % of requests that will enforce the local rate limit decision for a given route_key specified in the local rate limit configuration. +// // Defaults to 0. This can be used to test what would happen before fully enforcing the outcome. func generateEnvoyLocalRateLimitEnforced() *envoy_core_v3.RuntimeFractionalPercent { return &envoy_core_v3.RuntimeFractionalPercent{