feat: Gateway supports the configuration of forwarding tcp/udp traffic. (#5445)

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
This commit is contained in:
hongzhouzi
2023-01-11 10:19:16 +08:00
committed by GitHub
parent c114d51a3b
commit 3a03b4a6e1
5 changed files with 45 additions and 1 deletions

View File

@@ -38,6 +38,10 @@ type ControllerSpec struct {
Config map[string]string `json:"config,omitempty"`
// +optional
Scope Scope `json:"scope,omitempty"`
// +optional
TCP map[string]string `json:"tcp,omitempty"`
// +optional
UDP map[string]string `json:"udp,omitempty"`
}
type ServiceSpec struct {

View File

@@ -48,6 +48,20 @@ func (in *ControllerSpec) DeepCopyInto(out *ControllerSpec) {
}
}
out.Scope = in.Scope
if in.TCP != nil {
in, out := &in.TCP, &out.TCP
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.UDP != nil {
in, out := &in.UDP, &out.UDP
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerSpec.