Add HTTPUrlRewrite Filter in Gateway API
This commit is contained in:
parent
3ca667a3d4
commit
a696f7c654
15 changed files with 754 additions and 110 deletions
|
@ -43,6 +43,7 @@ type Middleware struct {
|
|||
// Gateway API HTTPRoute filters middlewares.
|
||||
RequestHeaderModifier *RequestHeaderModifier `json:"requestHeaderModifier,omitempty" toml:"-" yaml:"-" label:"-" file:"-" kv:"-" export:"true"`
|
||||
RequestRedirect *RequestRedirect `json:"requestRedirect,omitempty" toml:"-" yaml:"-" label:"-" file:"-" kv:"-" export:"true"`
|
||||
URLRewrite *URLRewrite `json:"URLRewrite,omitempty" toml:"-" yaml:"-" label:"-" file:"-" kv:"-" export:"true"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen=true
|
||||
|
@ -703,3 +704,12 @@ type RequestRedirect struct {
|
|||
PathPrefix *string `json:"pathPrefix,omitempty"`
|
||||
StatusCode int `json:"statusCode,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen=true
|
||||
|
||||
// URLRewrite holds the URL rewrite middleware configuration.
|
||||
type URLRewrite struct {
|
||||
Hostname *string `json:"hostname,omitempty"`
|
||||
Path *string `json:"path,omitempty"`
|
||||
PathPrefix *string `json:"pathPrefix,omitempty"`
|
||||
}
|
||||
|
|
|
@ -869,6 +869,11 @@ func (in *Middleware) DeepCopyInto(out *Middleware) {
|
|||
*out = new(RequestRedirect)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.URLRewrite != nil {
|
||||
in, out := &in.URLRewrite, &out.URLRewrite
|
||||
*out = new(URLRewrite)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -2205,6 +2210,37 @@ func (in *UDPWeightedRoundRobin) DeepCopy() *UDPWeightedRoundRobin {
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *URLRewrite) DeepCopyInto(out *URLRewrite) {
|
||||
*out = *in
|
||||
if in.Hostname != nil {
|
||||
in, out := &in.Hostname, &out.Hostname
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.Path != nil {
|
||||
in, out := &in.Path, &out.Path
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.PathPrefix != nil {
|
||||
in, out := &in.PathPrefix, &out.PathPrefix
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new URLRewrite.
|
||||
func (in *URLRewrite) DeepCopy() *URLRewrite {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(URLRewrite)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in Users) DeepCopyInto(out *Users) {
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue