Merge pull request #1524 from Megum1n/main

Change Gloo Duration type to string
This commit is contained in:
Stefan Prodan
2023-10-03 12:11:20 +03:00
committed by GitHub
3 changed files with 12 additions and 57 deletions
+8 -13
View File
@@ -91,23 +91,23 @@ type CircuitBreakerConfig struct {
type ConnectionConfig struct {
MaxRequestsPerConnection uint32 `json:"maxRequestsPerConnection,omitempty"`
ConnectTimeout *Duration `json:"connectTimeout,omitempty"`
ConnectTimeout string `json:"connectTimeout,omitempty"`
TcpKeepalive *ConnectionConfig_TcpKeepAlive `json:"tcpKeepalive,omitempty"`
PerConnectionBufferLimitBytes uint32 `json:"perConnectionBufferLimitBytes,omitempty"`
CommonHttpProtocolOptions *ConnectionConfig_HttpProtocolOptions `json:"commonHttpProtocolOptions,omitempty"`
}
type ConnectionConfig_TcpKeepAlive struct {
KeepaliveProbes uint32 `json:"keepaliveProbes,omitempty"`
KeepaliveTime *Duration `json:"keepaliveTime,omitempty"`
KeepaliveInterval *Duration `json:"keepaliveInterval,omitempty"`
KeepaliveProbes uint32 `json:"keepaliveProbes,omitempty"`
KeepaliveTime string `json:"keepaliveTime,omitempty"`
KeepaliveInterval string `json:"keepaliveInterval,omitempty"`
}
type ConnectionConfig_HttpProtocolOptions struct {
IdleTimeout *Duration `json:"idleTimeout,omitempty"`
MaxHeadersCount uint32 `json:"maxHeadersCount,omitempty"`
MaxStreamDuration *Duration `json:"maxStreamDuration,omitempty"`
HeadersWithUnderscoresAction uint32 `json:"headersWithUnderscoresAction,omitempty"`
IdleTimeout string `json:"idleTimeout,omitempty"`
MaxHeadersCount uint32 `json:"maxHeadersCount,omitempty"`
MaxStreamDuration string `json:"maxStreamDuration,omitempty"`
HeadersWithUnderscoresAction uint32 `json:"headersWithUnderscoresAction,omitempty"`
}
type LoadBalancerConfig struct {
@@ -130,11 +130,6 @@ type SlowStartConfig struct {
MinWeightPercent float64 `json:"minWeightPercent,omitempty"`
}
type Duration struct {
Seconds int64 `json:"seconds,omitempty"`
Nanos int32 `json:"nanos,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// UpstreamList is a list of Upstream resources
+2 -43
View File
@@ -82,20 +82,15 @@ func (in *CircuitBreakerConfig) DeepCopy() *CircuitBreakerConfig {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConnectionConfig) DeepCopyInto(out *ConnectionConfig) {
*out = *in
if in.ConnectTimeout != nil {
in, out := &in.ConnectTimeout, &out.ConnectTimeout
*out = new(Duration)
**out = **in
}
if in.TcpKeepalive != nil {
in, out := &in.TcpKeepalive, &out.TcpKeepalive
*out = new(ConnectionConfig_TcpKeepAlive)
(*in).DeepCopyInto(*out)
**out = **in
}
if in.CommonHttpProtocolOptions != nil {
in, out := &in.CommonHttpProtocolOptions, &out.CommonHttpProtocolOptions
*out = new(ConnectionConfig_HttpProtocolOptions)
(*in).DeepCopyInto(*out)
**out = **in
}
return
}
@@ -113,16 +108,6 @@ func (in *ConnectionConfig) DeepCopy() *ConnectionConfig {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConnectionConfig_HttpProtocolOptions) DeepCopyInto(out *ConnectionConfig_HttpProtocolOptions) {
*out = *in
if in.IdleTimeout != nil {
in, out := &in.IdleTimeout, &out.IdleTimeout
*out = new(Duration)
**out = **in
}
if in.MaxStreamDuration != nil {
in, out := &in.MaxStreamDuration, &out.MaxStreamDuration
*out = new(Duration)
**out = **in
}
return
}
@@ -139,16 +124,6 @@ func (in *ConnectionConfig_HttpProtocolOptions) DeepCopy() *ConnectionConfig_Htt
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConnectionConfig_TcpKeepAlive) DeepCopyInto(out *ConnectionConfig_TcpKeepAlive) {
*out = *in
if in.KeepaliveTime != nil {
in, out := &in.KeepaliveTime, &out.KeepaliveTime
*out = new(Duration)
**out = **in
}
if in.KeepaliveInterval != nil {
in, out := &in.KeepaliveInterval, &out.KeepaliveInterval
*out = new(Duration)
**out = **in
}
return
}
@@ -162,22 +137,6 @@ func (in *ConnectionConfig_TcpKeepAlive) DeepCopy() *ConnectionConfig_TcpKeepAli
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Duration) DeepCopyInto(out *Duration) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Duration.
func (in *Duration) DeepCopy() *Duration {
if in == nil {
return nil
}
out := new(Duration)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeUpstream) DeepCopyInto(out *KubeUpstream) {
*out = *in
+2 -1
View File
@@ -39,6 +39,7 @@ spec:
- addr: "example.com"
port: 80
connectionConfig:
connectTimeout: 2s
maxRequestsPerConnection: 51
loadBalancerConfig:
roundRobin:
@@ -221,4 +222,4 @@ echo '✔ A/B testing promotion test passed'
kubectl -n gloo-system logs deployment/flagger
echo '✔ All tests passed'
echo '✔ All tests passed'