Skip to content

Commit e64b378

Browse files
committed
fix: retry AgentRuntime CR creation for webhook readiness in e2e
Wrap AgentRuntime CR apply in Eventually with 1m timeout and 5s poll, matching the retry pattern already used by authbridge and combined e2e tests. Fixes flaky webhook connection-refused race when the validation webhook TCP listener isn't accepting connections yet despite endpoint being registered. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
1 parent b6963e6 commit e64b378

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

kagenti-operator/test/e2e/e2e_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,9 +1163,11 @@ rules:
11631163
Expect(err).NotTo(HaveOccurred())
11641164
Expect(utils.WaitForDeploymentReady("runtime-agent-target", agentRuntimeTestNamespace, 2*time.Minute)).To(Succeed())
11651165

1166-
By("creating AgentRuntime CR")
1167-
_, err = utils.KubectlApplyStdin(runtimeAgentCRFixture(), agentRuntimeTestNamespace)
1168-
Expect(err).NotTo(HaveOccurred())
1166+
By("creating AgentRuntime CR (with retry for webhook readiness)")
1167+
Eventually(func() error {
1168+
_, err := utils.KubectlApplyStdin(runtimeAgentCRFixture(), agentRuntimeTestNamespace)
1169+
return err
1170+
}, 1*time.Minute, 5*time.Second).Should(Succeed())
11691171

11701172
By("verifying kagenti.io/type=agent on workload metadata")
11711173
Eventually(func(g Gomega) {

0 commit comments

Comments
 (0)