Skip to content

Commit

Permalink
test: Add integration test for reconcile annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
marc1404 committed Dec 13, 2024
1 parent 0bc0ffd commit 5192e01
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/integration/compound/compound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/gardener/controller-manager-library/pkg/controllermanager"
"github.com/gardener/external-dns-management/pkg/dns"
"github.com/gardener/external-dns-management/pkg/dns/provider"
"github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
. "github.com/gardener/gardener/pkg/utils/test/matchers"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -410,6 +411,27 @@ var _ = Describe("Compound controller tests", func() {
By("check mock database")
checkSingleEntryInMockDatabase(nil)
})

It("should remove the Gardener reconcile operation annotation after reconciliation", func() {
By("Create new DNS entry")
Expect(testClient.Create(ctx, e1)).To(Succeed())
DeferCleanup(func() {
Expect(testClient.Delete(ctx, e1)).To(Succeed())
})
checkEntry(e1)

By("Set reconcile annotation on DNS entry")
e1.Annotations = map[string]string{
constants.GardenerOperation: "Reconcile",
}
Expect(testClient.Update(ctx, e1)).To(Succeed())

By("Wait for the reconcile annotation to be removed from the DNS entry")
Eventually(func(g Gomega) {
g.Expect(testClient.Get(ctx, client.ObjectKeyFromObject(e1), e1)).To(Succeed())
g.Expect(e1.Annotations).NotTo(HaveKey(constants.GardenerOperation))
})
})
})

func quoted(txt []string) []string {
Expand Down

0 comments on commit 5192e01

Please sign in to comment.