diff --git a/ocs_ci/ocs/constants.py b/ocs_ci/ocs/constants.py index c28a8c7d651..8ca783ea4b3 100644 --- a/ocs_ci/ocs/constants.py +++ b/ocs_ci/ocs/constants.py @@ -209,6 +209,7 @@ OPENSHIFT_STORAGE_NAMESPACE = "openshift-storage" MANAGED_FUSION_NAMESPACE = "managed-fusion" OPENSHIFT_MACHINE_API_NAMESPACE = "openshift-machine-api" +OPENSHIFT_API_CLUSTER_OPERATOR = "kube-apiserver" OPENSHIFT_LOGGING_NAMESPACE = "openshift-logging" OPENSHIFT_OPERATORS_REDHAT_NAMESPACE = "openshift-operators-redhat" OPENSHIFT_IMAGE_REGISTRY_NAMESPACE = "openshift-image-registry" diff --git a/ocs_ci/utility/ssl_certs.py b/ocs_ci/utility/ssl_certs.py index 9b655d3a732..52d29f94f9a 100644 --- a/ocs_ci/utility/ssl_certs.py +++ b/ocs_ci/utility/ssl_certs.py @@ -14,6 +14,7 @@ from ocs_ci.utility.utils import ( download_file, exec_cmd, + TimeoutSampler, wait_for_machineconfigpool_status, ) @@ -344,6 +345,22 @@ def configure_custom_api_cert(skip_tls_verify=False, wait_for_machineconfigpool= wait_for_machineconfigpool_status( "all", timeout=1800, skip_tls_verify=skip_tls_verify ) + logger.info( + f"Checking cluster status of {constants.OPENSHIFT_API_CLUSTER_OPERATOR}" + ) + for sampler in TimeoutSampler( + timeout=1000, + sleep=10, + func=ocp.verify_cluster_operator_status, + cluster_operator=constants.OPENSHIFT_API_CLUSTER_OPERATOR, + ): + if sampler: + logger.info(f"{constants.OPENSHIFT_API_CLUSTER_OPERATOR} status is valid") + break + else: + logger.info( + f"{constants.OPENSHIFT_API_CLUSTER_OPERATOR} status is not valid" + ) def configure_ingress_and_api_certificates(skip_tls_verify=False):