mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Parity for namespace handling in secrets E2E
This commit is contained in:
parent
0eca26fa18
commit
db29d22cab
@ -24,20 +24,31 @@ import (
|
|||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Secrets", func() {
|
var _ = Describe("Secrets", func() {
|
||||||
var c *client.Client
|
var c *client.Client
|
||||||
|
var ns string
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
var err error
|
var err error
|
||||||
c, err = loadClient()
|
c, err = loadClient()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
expectNoError(err)
|
||||||
|
ns_, err := createTestingNS("secrets", c)
|
||||||
|
ns = ns_.Name
|
||||||
|
expectNoError(err)
|
||||||
|
})
|
||||||
|
|
||||||
|
AfterEach(func() {
|
||||||
|
// Clean up the namespace if a non-default one was used
|
||||||
|
if ns != api.NamespaceDefault {
|
||||||
|
By("Cleaning up the namespace")
|
||||||
|
err := c.Namespaces().Delete(ns)
|
||||||
|
expectNoError(err)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
It("should be consumable from pods", func() {
|
It("should be consumable from pods", func() {
|
||||||
ns := api.NamespaceDefault
|
|
||||||
name := "secret-test-" + string(util.NewUUID())
|
name := "secret-test-" + string(util.NewUUID())
|
||||||
volumeName := "secret-volume"
|
volumeName := "secret-volume"
|
||||||
volumeMountPath := "/etc/secret-volume"
|
volumeMountPath := "/etc/secret-volume"
|
||||||
@ -83,7 +94,7 @@ var _ = Describe("Secrets", func() {
|
|||||||
},
|
},
|
||||||
Containers: []api.Container{
|
Containers: []api.Container{
|
||||||
{
|
{
|
||||||
Name: "catcont",
|
Name: "secret-test",
|
||||||
Image: "kubernetes/mounttest:0.1",
|
Image: "kubernetes/mounttest:0.1",
|
||||||
Args: []string{
|
Args: []string{
|
||||||
"--file_content=/etc/secret-volume/data-1",
|
"--file_content=/etc/secret-volume/data-1",
|
||||||
@ -101,9 +112,9 @@ var _ = Describe("Secrets", func() {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
testContainerOutput("consume secrets", c, pod, []string{
|
testContainerOutputInNamespace("consume secrets", c, pod, []string{
|
||||||
"content of file \"/etc/secret-volume/data-1\": value-1",
|
"content of file \"/etc/secret-volume/data-1\": value-1",
|
||||||
"mode of file \"/etc/secret-volume/data-1\": -r--r--r--",
|
"mode of file \"/etc/secret-volume/data-1\": -r--r--r--",
|
||||||
})
|
}, ns)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user