support custom configuration to main context of nginx config
This commit is contained in:
parent
23ce9b5db1
commit
1bacf1655e
4 changed files with 55 additions and 3 deletions
43
test/e2e/settings/main_snippet.go
Normal file
43
test/e2e/settings/main_snippet.go
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package settings
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"k8s.io/ingress-nginx/test/e2e/framework"
|
||||
)
|
||||
|
||||
var _ = framework.IngressNginxDescribe("Main Snippet", func() {
|
||||
f := framework.NewDefaultFramework("main-snippet")
|
||||
mainSnippet := "main-snippet"
|
||||
|
||||
It("should add value of main-snippet setting to nginx config", func() {
|
||||
expectedComment := "# main snippet"
|
||||
err := f.UpdateNginxConfigMapData(mainSnippet, expectedComment)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
err = f.WaitForNginxConfiguration(
|
||||
func(cfg string) bool {
|
||||
return strings.Contains(cfg, expectedComment)
|
||||
})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue