From 4e05e5cb7a30e963ead558eaabe7f7d28bd40dc0 Mon Sep 17 00:00:00 2001 From: Adrien Gentil Date: Tue, 8 Apr 2025 10:29:33 +0200 Subject: [PATCH 1/2] wait for hostedcluster infrastructure to be ready Wait for the infrastructure to be ready so HostedClutser the returned in `hosted_cluster_result` will contain the control plane IP and port. https://github.com/openshift/hypershift/blob/main/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go#L636-L650 --- roles/hosted_cluster/tasks/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/roles/hosted_cluster/tasks/main.yml b/roles/hosted_cluster/tasks/main.yml index fff238732..88c81fb45 100644 --- a/roles/hosted_cluster/tasks/main.yml +++ b/roles/hosted_cluster/tasks/main.yml @@ -100,3 +100,15 @@ matchLabels: "{{ hosted_cluster_default_cluster_order_label }}" release: image: "quay.io/openshift-release-dev/ocp-release:{{ hosted_cluster_settings.ocp_version }}" + +- name: Wait for HostedCluster infrastructure to be ready + kubernetes.core.k8s_info: + kind: HostedCluster + namespace: "{{ hosted_cluster_namespace }}" + name: "{{ hosted_cluster_name }}" + wait_condition: + reason: "AsExpected" + status: "True" + type: "InfrastructureReady" + wait_timeout: 600 + register: hosted_cluster_result From 4bc18f025ce4c9f6c4e9140150c87e73ee16b73d Mon Sep 17 00:00:00 2001 From: Adrien Gentil Date: Tue, 8 Apr 2025 11:32:25 +0200 Subject: [PATCH 2/2] add api_version to the query --- roles/hosted_cluster/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/hosted_cluster/tasks/main.yml b/roles/hosted_cluster/tasks/main.yml index 88c81fb45..f40dfecb7 100644 --- a/roles/hosted_cluster/tasks/main.yml +++ b/roles/hosted_cluster/tasks/main.yml @@ -103,6 +103,7 @@ - name: Wait for HostedCluster infrastructure to be ready kubernetes.core.k8s_info: + api_version: hypershift.openshift.io/v1alpha1 kind: HostedCluster namespace: "{{ hosted_cluster_namespace }}" name: "{{ hosted_cluster_name }}"