forked from cloudfoundry-incubator/quarks-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create 'link' secrets for BOSH links in deployment
[#169418463](https://www.pivotaltracker.com/story/show/169418463)
- Loading branch information
Mario Manno
authored and
Vlad Iovanov
committed
Nov 30, 2019
1 parent
ee3ea37
commit 0ddf0f3
Showing
19 changed files
with
347 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
binaries/ | ||
build/ | ||
helm/ | ||
tmp/ | ||
|
||
deploy/ | ||
docs/ | ||
e2e/ | ||
integration/ | ||
testing/ | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package integration_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
corev1 "k8s.io/api/core/v1" | ||
|
||
bm "code.cloudfoundry.org/cf-operator/testing/boshmanifest" | ||
"code.cloudfoundry.org/quarks-utils/testing/machine" | ||
) | ||
|
||
var _ = Describe("BOSHLinks", func() { | ||
const ( | ||
manifestRef = "manifest" | ||
deploymentName = "test" | ||
) | ||
|
||
var ( | ||
tearDowns []machine.TearDownFunc | ||
boshManifest corev1.Secret | ||
) | ||
|
||
AfterEach(func() { | ||
Expect(env.TearDownAll(tearDowns)).To(Succeed()) | ||
}) | ||
|
||
JustBeforeEach(func() { | ||
tearDown, err := env.CreateSecret(env.Namespace, boshManifest) | ||
Expect(err).NotTo(HaveOccurred()) | ||
tearDowns = append(tearDowns, tearDown) | ||
|
||
_, tearDown, err = env.CreateBOSHDeployment(env.Namespace, | ||
env.SecretBOSHDeployment(deploymentName, manifestRef)) | ||
Expect(err).NotTo(HaveOccurred()) | ||
tearDowns = append(tearDowns, tearDown) | ||
}) | ||
|
||
Context("when deployment has implicit links only", func() { | ||
BeforeEach(func() { | ||
boshManifest = env.BOSHManifestSecret(manifestRef, bm.NatsSmall) | ||
}) | ||
|
||
It("creates a secret for each link", func() { | ||
By("waiting for secrets", func() { | ||
secretName := "link-test-nats" | ||
err := env.WaitForSecret(env.Namespace, secretName) | ||
Expect(err).NotTo(HaveOccurred()) | ||
secret, err := env.GetSecret(env.Namespace, secretName) | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(secret.Data).Should(HaveKeyWithValue("nats.nats", []byte("{\"nats\":{\"password\":\"changeme\",\"port\":4222,\"user\":\"admin\"}}"))) | ||
}) | ||
}) | ||
}) | ||
|
||
Context("when deployment has explicit links", func() { | ||
BeforeEach(func() { | ||
boshManifest = env.BOSHManifestSecret(manifestRef, bm.NatsSmallWithLinks) | ||
}) | ||
|
||
It("creates a secret for each link", func() { | ||
By("waiting for secrets", func() { | ||
err := env.WaitForSecret(env.Namespace, "link-test-nats") | ||
Expect(err).NotTo(HaveOccurred()) | ||
secret, err := env.GetSecret(env.Namespace, "link-test-nats") | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(secret.Data).Should(HaveKeyWithValue("nats.nuts", []byte("{\"nats\":{\"password\":\"changeme\",\"port\":4222,\"user\":\"admin\"}}"))) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.