From 21ee669e3ab2868c348ab355e006ac7c272a75a1 Mon Sep 17 00:00:00 2001 From: rhjcd Date: Tue, 10 Nov 2026 17:44:33 -0800 Subject: [PATCH] fix: retry HyperConverged apply through HCO webhook outages The 'Create the HyperConverged instance' task applies the HyperConverged CR immediately after the kubevirt-hyperconverged CSV is subscribed. While the operator is still rolling out, the HCO conversion webhook (hco-webhook-service:4343) is not yet serving, so the apply fails with: conversion webhook for hco.kubevirt.io/v1, Kind=HyperConverged failed: Post "https://hco-webhook-service.openshift-cnv.svc:4343/convert": connect: connection refused (HTTP 500) #200 added retry/until to the subsequent read ('Wait until HyperConverged is installed') but left the apply itself unprotected, so a webhook outage during the apply still fails the deploy outright. Add the same retry/until to the apply, reusing the existing hco_wait_retries/hco_wait_delay vars. Observed intermittently on the RHACS CNV demo (rhacs-demo-cnv); the operator took ~11 min to reach CSV Succeeded, and the apply landed in that window. --- .../tasks/workload.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/ocp4_workload_openshift_virtualization/tasks/workload.yml b/roles/ocp4_workload_openshift_virtualization/tasks/workload.yml index 3d94a4f..14065e0 100644 --- a/roles/ocp4_workload_openshift_virtualization/tasks/workload.yml +++ b/roles/ocp4_workload_openshift_virtualization/tasks/workload.yml @@ -35,6 +35,16 @@ kubernetes.core.k8s: state: present definition: "{{ lookup('template', 'hyperconverged.yaml.j2') }}" + # The HCO conversion webhook (hco-webhook-service:4343) can be briefly + # unavailable while the operator is still rolling out - its pods reboot and + # the endpoint is not yet serving until the CSV reaches Succeeded. During + # that window this apply fails with an HTTP 500 "conversion webhook ... + # connect: connection refused". Retry the apply until it goes through, + # mirroring the wait below (#200 only hardened the read, not the apply). + register: r_openshift_virtualization_hco_create + until: r_openshift_virtualization_hco_create is succeeded + retries: "{{ ocp4_workload_openshift_virtualization_hco_wait_retries }}" + delay: "{{ ocp4_workload_openshift_virtualization_hco_wait_delay }}" - name: Wait until HyperConverged is installed kubernetes.core.k8s_info: