Disable Cross-Namespace by default for IngressRoute provider

This commit is contained in:
Daniel Tomcej 2021-07-13 02:48:05 -06:00 committed by GitHub
parent 14499cd6e5
commit 3072354ca5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 30 deletions

View file

@ -1153,8 +1153,7 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
return
}
p := Provider{IngressClass: test.ingressClass}
p.SetDefaults()
p := Provider{IngressClass: test.ingressClass, AllowCrossNamespace: true}
clientMock := newClientMock(test.paths...)
conf := p.loadConfigurationFromCRD(context.Background(), clientMock)
@ -3338,8 +3337,7 @@ func TestLoadIngressRoutes(t *testing.T) {
return
}
p := Provider{IngressClass: test.ingressClass}
p.SetDefaults()
p := Provider{IngressClass: test.ingressClass, AllowCrossNamespace: true}
clientMock := newClientMock(test.paths...)
conf := p.loadConfigurationFromCRD(context.Background(), clientMock)
@ -3655,8 +3653,7 @@ func TestLoadIngressRouteUDPs(t *testing.T) {
return
}
p := Provider{IngressClass: test.ingressClass}
p.SetDefaults()
p := Provider{IngressClass: test.ingressClass, AllowCrossNamespace: true}
clientMock := newClientMock(test.paths...)
conf := p.loadConfigurationFromCRD(context.Background(), clientMock)
@ -4439,9 +4436,8 @@ func TestCrossNamespace(t *testing.T) {
}
p := Provider{}
p.SetDefaults()
p.AllowCrossNamespace = func(b bool) *bool { return &b }(test.allowCrossNamespace)
p.AllowCrossNamespace = test.allowCrossNamespace
conf := p.loadConfigurationFromCRD(context.Background(), client)
assert.Equal(t, test.expected, conf)
})