Renaming IPWhiteList to IPAllowList
This commit is contained in:
parent
e86f21ae7b
commit
1b9873cae9
69 changed files with 523 additions and 506 deletions
|
@ -1,10 +1,10 @@
|
|||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: MiddlewareTCP
|
||||
metadata:
|
||||
name: ipwhitelist
|
||||
name: ipallowlist
|
||||
namespace: default
|
||||
spec:
|
||||
ipWhiteList:
|
||||
ipAllowList:
|
||||
sourceRange:
|
||||
- 127.0.0.1/32
|
||||
|
||||
|
@ -12,10 +12,10 @@ spec:
|
|||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: MiddlewareTCP
|
||||
metadata:
|
||||
name: ipwhitelist
|
||||
name: ipallowlist
|
||||
namespace: foo
|
||||
spec:
|
||||
ipWhiteList:
|
||||
ipAllowList:
|
||||
sourceRange:
|
||||
- 127.0.0.1/32
|
||||
---
|
||||
|
@ -36,6 +36,6 @@ spec:
|
|||
port: 8000
|
||||
|
||||
middlewares:
|
||||
- name: ipwhitelist
|
||||
- name: ipwhitelist
|
||||
- name: ipallowlist
|
||||
- name: ipallowlist
|
||||
namespace: foo
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: MiddlewareTCP
|
||||
metadata:
|
||||
name: ipwhitelist
|
||||
name: ipallowlist
|
||||
namespace: default
|
||||
spec:
|
||||
ipWhiteList:
|
||||
ipAllowList:
|
||||
sourceRange:
|
||||
- 127.0.0.1/32
|
||||
|
||||
|
@ -12,10 +12,10 @@ spec:
|
|||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: MiddlewareTCP
|
||||
metadata:
|
||||
name: ipwhitelist
|
||||
name: ipallowlist
|
||||
namespace: foo
|
||||
spec:
|
||||
ipWhiteList:
|
||||
ipAllowList:
|
||||
sourceRange:
|
||||
- 127.0.0.1/32
|
||||
---
|
||||
|
@ -36,9 +36,9 @@ spec:
|
|||
port: 8000
|
||||
|
||||
middlewares:
|
||||
- name: ipwhitelist
|
||||
- name: ipwhitelist
|
||||
- name: ipallowlist
|
||||
- name: ipallowlist
|
||||
namespace: foo
|
||||
- name: ipwhitelist@file
|
||||
- name: ipwhitelist-foo@file
|
||||
- name: ipallowlist@file
|
||||
- name: ipallowlist-foo@file
|
||||
namespace: foo
|
||||
|
|
|
@ -4,7 +4,7 @@ metadata:
|
|||
name: multiple---hyphens
|
||||
namespace: default
|
||||
spec:
|
||||
ipWhiteList:
|
||||
ipAllowList:
|
||||
sourceRange:
|
||||
- 127.0.0.1/32
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: MiddlewareTCP
|
||||
metadata:
|
||||
name: ipwhitelist
|
||||
name: ipallowlist
|
||||
namespace: default
|
||||
spec:
|
||||
ipWhiteList:
|
||||
ipAllowList:
|
||||
sourceRange:
|
||||
- 127.0.0.1/32
|
||||
|
||||
|
@ -12,10 +12,10 @@ spec:
|
|||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: MiddlewareTCP
|
||||
metadata:
|
||||
name: ipwhitelist
|
||||
name: ipallowlist
|
||||
namespace: cross-ns
|
||||
spec:
|
||||
ipWhiteList:
|
||||
ipAllowList:
|
||||
sourceRange:
|
||||
- 127.0.0.1/32
|
||||
---
|
||||
|
@ -36,7 +36,7 @@ spec:
|
|||
port: 8000
|
||||
|
||||
middlewares:
|
||||
- name: ipwhitelist
|
||||
- name: ipallowlist
|
||||
|
||||
- match: HostSNI(`bar.com`)
|
||||
services:
|
||||
|
@ -44,5 +44,5 @@ spec:
|
|||
port: 8000
|
||||
|
||||
middlewares:
|
||||
- name: ipwhitelist
|
||||
- name: ipallowlist
|
||||
namespace: cross-ns
|
||||
|
|
|
@ -263,7 +263,7 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client)
|
|||
ReplacePath: middleware.Spec.ReplacePath,
|
||||
ReplacePathRegex: middleware.Spec.ReplacePathRegex,
|
||||
Chain: createChainMiddleware(ctxMid, middleware.Namespace, middleware.Spec.Chain),
|
||||
IPWhiteList: middleware.Spec.IPWhiteList,
|
||||
IPAllowList: middleware.Spec.IPAllowList,
|
||||
Headers: middleware.Spec.Headers,
|
||||
Errors: errorPage,
|
||||
RateLimit: rateLimit,
|
||||
|
@ -288,7 +288,7 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client)
|
|||
|
||||
conf.TCP.Middlewares[id] = &dynamic.TCPMiddleware{
|
||||
InFlightConn: middlewareTCP.Spec.InFlightConn,
|
||||
IPWhiteList: middlewareTCP.Spec.IPWhiteList,
|
||||
IPAllowList: middlewareTCP.Spec.IPAllowList,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -119,18 +119,18 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
"default-test.route-fdd3e9338e47a45efefc": {
|
||||
EntryPoints: []string{"foo"},
|
||||
Service: "default-test.route-fdd3e9338e47a45efefc",
|
||||
Middlewares: []string{"default-ipwhitelist", "foo-ipwhitelist"},
|
||||
Middlewares: []string{"default-ipallowlist", "foo-ipallowlist"},
|
||||
Rule: "HostSNI(`foo.com`)",
|
||||
},
|
||||
},
|
||||
Middlewares: map[string]*dynamic.TCPMiddleware{
|
||||
"default-ipwhitelist": {
|
||||
IPWhiteList: &dynamic.TCPIPWhiteList{
|
||||
"default-ipallowlist": {
|
||||
IPAllowList: &dynamic.TCPIPAllowList{
|
||||
SourceRange: []string{"127.0.0.1/32"},
|
||||
},
|
||||
},
|
||||
"foo-ipwhitelist": {
|
||||
IPWhiteList: &dynamic.TCPIPWhiteList{
|
||||
"foo-ipallowlist": {
|
||||
IPAllowList: &dynamic.TCPIPAllowList{
|
||||
SourceRange: []string{"127.0.0.1/32"},
|
||||
},
|
||||
},
|
||||
|
@ -178,7 +178,7 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
},
|
||||
Middlewares: map[string]*dynamic.TCPMiddleware{
|
||||
"default-multiple-hyphens": {
|
||||
IPWhiteList: &dynamic.TCPIPWhiteList{
|
||||
IPAllowList: &dynamic.TCPIPAllowList{
|
||||
SourceRange: []string{"127.0.0.1/32"},
|
||||
},
|
||||
},
|
||||
|
@ -220,18 +220,18 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
"default-test.route-fdd3e9338e47a45efefc": {
|
||||
EntryPoints: []string{"foo"},
|
||||
Service: "default-test.route-fdd3e9338e47a45efefc",
|
||||
Middlewares: []string{"default-ipwhitelist", "foo-ipwhitelist", "ipwhitelist@file", "ipwhitelist-foo@file"},
|
||||
Middlewares: []string{"default-ipallowlist", "foo-ipallowlist", "ipallowlist@file", "ipallowlist-foo@file"},
|
||||
Rule: "HostSNI(`foo.com`)",
|
||||
},
|
||||
},
|
||||
Middlewares: map[string]*dynamic.TCPMiddleware{
|
||||
"default-ipwhitelist": {
|
||||
IPWhiteList: &dynamic.TCPIPWhiteList{
|
||||
"default-ipallowlist": {
|
||||
IPAllowList: &dynamic.TCPIPAllowList{
|
||||
SourceRange: []string{"127.0.0.1/32"},
|
||||
},
|
||||
},
|
||||
"foo-ipwhitelist": {
|
||||
IPWhiteList: &dynamic.TCPIPWhiteList{
|
||||
"foo-ipallowlist": {
|
||||
IPAllowList: &dynamic.TCPIPAllowList{
|
||||
SourceRange: []string{"127.0.0.1/32"},
|
||||
},
|
||||
},
|
||||
|
@ -5459,18 +5459,18 @@ func TestCrossNamespace(t *testing.T) {
|
|||
"default-test.route-fdd3e9338e47a45efefc": {
|
||||
EntryPoints: []string{"foo"},
|
||||
Service: "default-test.route-fdd3e9338e47a45efefc",
|
||||
Middlewares: []string{"default-ipwhitelist"},
|
||||
Middlewares: []string{"default-ipallowlist"},
|
||||
Rule: "HostSNI(`foo.com`)",
|
||||
},
|
||||
},
|
||||
Middlewares: map[string]*dynamic.TCPMiddleware{
|
||||
"default-ipwhitelist": {
|
||||
IPWhiteList: &dynamic.TCPIPWhiteList{
|
||||
"default-ipallowlist": {
|
||||
IPAllowList: &dynamic.TCPIPAllowList{
|
||||
SourceRange: []string{"127.0.0.1/32"},
|
||||
},
|
||||
},
|
||||
"cross-ns-ipwhitelist": {
|
||||
IPWhiteList: &dynamic.TCPIPWhiteList{
|
||||
"cross-ns-ipallowlist": {
|
||||
IPAllowList: &dynamic.TCPIPAllowList{
|
||||
SourceRange: []string{"127.0.0.1/32"},
|
||||
},
|
||||
},
|
||||
|
@ -5513,24 +5513,24 @@ func TestCrossNamespace(t *testing.T) {
|
|||
"default-test.route-fdd3e9338e47a45efefc": {
|
||||
EntryPoints: []string{"foo"},
|
||||
Service: "default-test.route-fdd3e9338e47a45efefc",
|
||||
Middlewares: []string{"default-ipwhitelist"},
|
||||
Middlewares: []string{"default-ipallowlist"},
|
||||
Rule: "HostSNI(`foo.com`)",
|
||||
},
|
||||
"default-test.route-f44ce589164e656d231c": {
|
||||
EntryPoints: []string{"foo"},
|
||||
Service: "default-test.route-f44ce589164e656d231c",
|
||||
Middlewares: []string{"cross-ns-ipwhitelist"},
|
||||
Middlewares: []string{"cross-ns-ipallowlist"},
|
||||
Rule: "HostSNI(`bar.com`)",
|
||||
},
|
||||
},
|
||||
Middlewares: map[string]*dynamic.TCPMiddleware{
|
||||
"default-ipwhitelist": {
|
||||
IPWhiteList: &dynamic.TCPIPWhiteList{
|
||||
"default-ipallowlist": {
|
||||
IPAllowList: &dynamic.TCPIPAllowList{
|
||||
SourceRange: []string{"127.0.0.1/32"},
|
||||
},
|
||||
},
|
||||
"cross-ns-ipwhitelist": {
|
||||
IPWhiteList: &dynamic.TCPIPWhiteList{
|
||||
"cross-ns-ipallowlist": {
|
||||
IPAllowList: &dynamic.TCPIPAllowList{
|
||||
SourceRange: []string{"127.0.0.1/32"},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -32,7 +32,7 @@ type MiddlewareSpec struct {
|
|||
ReplacePath *dynamic.ReplacePath `json:"replacePath,omitempty"`
|
||||
ReplacePathRegex *dynamic.ReplacePathRegex `json:"replacePathRegex,omitempty"`
|
||||
Chain *Chain `json:"chain,omitempty"`
|
||||
IPWhiteList *dynamic.IPWhiteList `json:"ipWhiteList,omitempty"`
|
||||
IPAllowList *dynamic.IPAllowList `json:"ipAllowList,omitempty"`
|
||||
Headers *dynamic.Headers `json:"headers,omitempty"`
|
||||
Errors *ErrorPage `json:"errors,omitempty"`
|
||||
RateLimit *RateLimit `json:"rateLimit,omitempty"`
|
||||
|
|
|
@ -25,8 +25,8 @@ type MiddlewareTCP struct {
|
|||
type MiddlewareTCPSpec struct {
|
||||
// InFlightConn defines the InFlightConn middleware configuration.
|
||||
InFlightConn *dynamic.TCPInFlightConn `json:"inFlightConn,omitempty"`
|
||||
// IPWhiteList defines the IPWhiteList middleware configuration.
|
||||
IPWhiteList *dynamic.TCPIPWhiteList `json:"ipWhiteList,omitempty"`
|
||||
// IPAllowList defines the IPAllowList middleware configuration.
|
||||
IPAllowList *dynamic.TCPIPAllowList `json:"ipAllowList,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
|
|
@ -689,9 +689,9 @@ func (in *MiddlewareSpec) DeepCopyInto(out *MiddlewareSpec) {
|
|||
*out = new(Chain)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.IPWhiteList != nil {
|
||||
in, out := &in.IPWhiteList, &out.IPWhiteList
|
||||
*out = new(dynamic.IPWhiteList)
|
||||
if in.IPAllowList != nil {
|
||||
in, out := &in.IPAllowList, &out.IPAllowList
|
||||
*out = new(dynamic.IPAllowList)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Headers != nil {
|
||||
|
@ -857,9 +857,9 @@ func (in *MiddlewareTCPSpec) DeepCopyInto(out *MiddlewareTCPSpec) {
|
|||
*out = new(dynamic.TCPInFlightConn)
|
||||
**out = **in
|
||||
}
|
||||
if in.IPWhiteList != nil {
|
||||
in, out := &in.IPWhiteList, &out.IPWhiteList
|
||||
*out = new(dynamic.TCPIPWhiteList)
|
||||
if in.IPAllowList != nil {
|
||||
in, out := &in.IPAllowList, &out.IPAllowList
|
||||
*out = new(dynamic.TCPIPAllowList)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue