Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test for upsi last operation update type #3660

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions controllers/controllers/services/instances/upsi/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,16 @@ var _ = Describe("CFServiceInstance", func() {
g.Expect(instance.Status.CredentialsObservedVersion).NotTo(Equal(secretVersion))
}).Should(Succeed())
})

It("sets the instance last operation update type", func() {
Eventually(func(g Gomega) {
g.Expect(adminClient.Get(ctx, client.ObjectKeyFromObject(instance), instance)).To(Succeed())
g.Expect(instance.Status.LastOperation).To(Equal(services.LastOperation{
Type: "update",
State: "succeeded",
}))
}).Should(Succeed())
})
})

When("the credentials secret gets deleted", func() {
Expand Down Expand Up @@ -196,24 +206,6 @@ var _ = Describe("CFServiceInstance", func() {
})
})

When("credentials observed version is not equal to the secret version", func() {
BeforeEach(func() {
Expect(k8s.Patch(ctx, adminClient, instance, func() {
instance.Status.CredentialsObservedVersion = "invalid-version"
})).To(Succeed())
})

It("sets the instance last operation update type", func() {
Eventually(func(g Gomega) {
g.Expect(adminClient.Get(ctx, client.ObjectKeyFromObject(instance), instance)).To(Succeed())
g.Expect(instance.Status.LastOperation).To(Equal(services.LastOperation{
Type: "update",
State: "succeeded",
}))
}).Should(Succeed())
})
})

When("the instance is deleted", func() {
JustBeforeEach(func() {
Expect(adminClient.Delete(ctx, instance)).To(Succeed())
Expand Down
Loading