Skip to content

Commit

Permalink
fix: retry when getting build PLR
Browse files Browse the repository at this point in the history
Signed-off-by: Hongwei Liu <[email protected]>
  • Loading branch information
hongweiliu17 committed Nov 26, 2024
1 parent 5a0785b commit 2af6142
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions internal/controller/buildpipeline/buildpipeline_adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1033,11 +1033,14 @@ var _ = Describe("Pipeline Adapter", Ordered, func() {
})
It("add pr group to the build pipelineRun annotations and labels", func() {
existingBuildPLR := new(tektonv1.PipelineRun)
err := k8sClient.Get(ctx, types.NamespacedName{
Namespace: buildPipelineRun.Namespace,
Name: buildPipelineRun.Name,
}, existingBuildPLR)
Expect(err).NotTo(HaveOccurred())
Eventually(func() bool {
err := k8sClient.Get(ctx, types.NamespacedName{
Namespace: buildPipelineRun.Namespace,
Name: buildPipelineRun.Name,
}, existingBuildPLR)
return err == nil
}, time.Second*10).Should(BeTrue())

Expect(metadata.HasAnnotation(existingBuildPLR, gitops.PRGroupAnnotation)).To(BeFalse())
Expect(metadata.HasLabel(existingBuildPLR, gitops.PRGroupHashLabel)).To(BeFalse())

Expand Down

0 comments on commit 2af6142

Please sign in to comment.