Skip to content

Commit

Permalink
Remove secret_controller and test; Use EnqueueRequestsFromMapFunc (re…
Browse files Browse the repository at this point in the history
…dhat-appstudio#670)

Signed-off-by: Keith Chong <kykchong@redhat.com>
  • Loading branch information
keithchong authored and jgwest committed Aug 29, 2023
1 parent 46c9737 commit 89a18db
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
)

var _ = Describe("GitOpsDeploymentManagedEnvironment Controller Test", func() {
//ctx := context.Background()

Context("Generic tests", func() {

Expand Down Expand Up @@ -108,6 +107,22 @@ var _ = Describe("GitOpsDeploymentManagedEnvironment Controller Test", func() {
})
})

When("GitOpsDeploymentManagedEnvironment references a secret of a different type. Expect no Managed Environment to be reconciled", func() {

It("should return a managed environment", func() {
By("create a NON-managed environment secret type")
secret := createSecretForManagedEnv(secretName, true, *namespace, k8sClient)

By("create a managed environment that references the secret")

managedEnv := createManagedEnvTargetingSecret("testManagedEnv", secret, *namespace, k8sClient)

// Now pass the managedEnv (anything other than a secret) and there should be no managed environments returned
By("check that a non-secret is passed and the code handles it properly")
Expect(reconciler.findSecretsForManagedEnvironment(&managedEnv)).To(BeEmpty())
})
})

When("GitOpsDeploymentManagedEnvironment references a secret of a different type. Expect no Managed Environment to be reconciled", func() {

It("should return a managed environment", func() {
Expand All @@ -124,7 +139,7 @@ var _ = Describe("GitOpsDeploymentManagedEnvironment Controller Test", func() {

When("Five GitOpsDeploymentManagedEnvironment reference a secret in the same namespace", func() {

It("should return two managed environments", func() {
It("should return five managed environments", func() {
By("create a managed environment secret type")
secret := createSecretForManagedEnv(secretName, true, *namespace, k8sClient)

Expand Down

0 comments on commit 89a18db

Please sign in to comment.