Disable user snippets per default (#10393)
* Disable user snippets per default * Enable snippet on tests
This commit is contained in:
parent
2d03da6334
commit
cf889c6c47
35 changed files with 494 additions and 288 deletions
|
|
@ -33,6 +33,15 @@ var _ = framework.DescribeAnnotation("server-snippet", func() {
|
|||
})
|
||||
|
||||
ginkgo.It(`add valid directives to server via server snippet`, func() {
|
||||
f.SetNginxConfigMapData(map[string]string{
|
||||
"allow-snippet-annotations": "true",
|
||||
})
|
||||
defer func() {
|
||||
f.SetNginxConfigMapData(map[string]string{
|
||||
"allow-snippet-annotations": "false",
|
||||
})
|
||||
}()
|
||||
|
||||
host := "serversnippet.foo.com"
|
||||
annotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/server-snippet": `
|
||||
|
|
@ -59,6 +68,15 @@ var _ = framework.DescribeAnnotation("server-snippet", func() {
|
|||
})
|
||||
|
||||
ginkgo.It(`drops server snippet if disabled by the administrator`, func() {
|
||||
f.SetNginxConfigMapData(map[string]string{
|
||||
"allow-snippet-annotations": "true",
|
||||
})
|
||||
defer func() {
|
||||
f.SetNginxConfigMapData(map[string]string{
|
||||
"allow-snippet-annotations": "false",
|
||||
})
|
||||
}()
|
||||
|
||||
host := "noserversnippet.foo.com"
|
||||
annotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/server-snippet": `
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue