Skip to content

Commit 66f6c74

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 9493217 commit 66f6c74

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
@@ -1138,9 +1138,11 @@ rules:
11381138
Expect(err).NotTo(HaveOccurred())
11391139
Expect(utils.WaitForDeploymentReady("runtime-agent-target", agentRuntimeTestNamespace, 2*time.Minute)).To(Succeed())
11401140

1141-
By("creating AgentRuntime CR")
1142-
_, err = utils.KubectlApplyStdin(runtimeAgentCRFixture(), agentRuntimeTestNamespace)
1143-
Expect(err).NotTo(HaveOccurred())
1141+
By("creating AgentRuntime CR (with retry for webhook readiness)")
1142+
Eventually(func() error {
1143+
_, err := utils.KubectlApplyStdin(runtimeAgentCRFixture(), agentRuntimeTestNamespace)
1144+
return err
1145+
}, 1*time.Minute, 5*time.Second).Should(Succeed())
11441146

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

0 commit comments

Comments
 (0)