Skip to content

Commit bb1c4aa

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 a90fd58 commit bb1c4aa

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

1185-
By("creating AgentRuntime CR")
1186-
_, err = utils.KubectlApplyStdin(runtimeAgentCRFixture(), agentRuntimeTestNamespace)
1187-
Expect(err).NotTo(HaveOccurred())
1185+
By("creating AgentRuntime CR (with retry for webhook readiness)")
1186+
Eventually(func() error {
1187+
_, err := utils.KubectlApplyStdin(runtimeAgentCRFixture(), agentRuntimeTestNamespace)
1188+
return err
1189+
}, 1*time.Minute, 5*time.Second).Should(Succeed())
11881190

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

0 commit comments

Comments
 (0)