Skip to content

Commit

Permalink
fix int64 marshal to string, use int32 to int
Browse files Browse the repository at this point in the history
Signed-off-by: zackzhangkai <zhangkaiamm@gmail.com>
  • Loading branch information
zackzhangkai authored and YonkaFang committed Jun 19, 2023
1 parent 6f5992a commit 24c2f36
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion install/init/crds-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)},
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 24c2f36

Please sign in to comment.