Skip to content

Commit

Permalink
Fix post-installation checks for client cluster (#9196)
Browse files Browse the repository at this point in the history
* Fix client operator name

Signed-off-by: Elena Bondarenko <[email protected]>

* Fix csv name for client cluster

Signed-off-by: Elena Bondarenko <[email protected]>

* Skip storagecluster checks for client

Signed-off-by: Elena Bondarenko <[email protected]>

* Skip noobaa checks for client

Signed-off-by: Elena Bondarenko <[email protected]>

* Fix csi drivers check for client

Signed-off-by: Elena Bondarenko <[email protected]>

* Fix provisioner secret names check for client

Signed-off-by: Elena Bondarenko <[email protected]>

* Skip another storagecluster check for client

Signed-off-by: Elena Bondarenko <[email protected]>

* Fix logic error

Signed-off-by: Elena Bondarenko <[email protected]>

* Skip max ocp version check for provider/client

Signed-off-by: Elena Bondarenko <[email protected]>

* Skip another noobaa check for client

Signed-off-by: Elena Bondarenko <[email protected]>

---------

Signed-off-by: Elena Bondarenko <[email protected]>
  • Loading branch information
ebondare authored Jan 22, 2024
1 parent a17a03c commit b1370c4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
6 changes: 5 additions & 1 deletion ocs_ci/ocs/resources/ocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def get_ocs_csv():
ver < VERSION_4_9
or config.ENV_DATA["platform"] == constants.FUSIONAAS_PLATFORM
)
else constants.OCS_CLIENT_OPERATOR
if config.ENV_DATA["platform"] in constants.HCI_PROVIDER_CLIENT_PLATFORMS
else defaults.ODF_OPERATOR_NAME
)
namespace = config.ENV_DATA["cluster_namespace"]
Expand All @@ -247,7 +249,9 @@ def get_ocs_csv():
if config.ENV_DATA["platform"].lower() in constants.HCI_PC_OR_MS_PLATFORM:
ocp_cluster = OCP(namespace=config.ENV_DATA["cluster_namespace"], kind="csv")
for item in ocp_cluster.get()["items"]:
if item["metadata"]["name"].startswith(defaults.OCS_OPERATOR_NAME):
if item["metadata"]["name"].startswith(defaults.OCS_OPERATOR_NAME) or item[
"metadata"
]["name"].startswith(constants.OCS_CLIENT_OPERATOR):
ocs_csv_name = item["metadata"]["name"]
if not ocs_csv_name:
raise CSVNotFound(f"No OCS CSV found for {config.ENV_DATA['platform']}")
Expand Down
31 changes: 17 additions & 14 deletions ocs_ci/ocs/resources/storage_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ def ocs_install_verification(
fusion_aas_provider = fusion_aas and provider_cluster

# Basic Verification for cluster
if not fusion_aas_consumer:
if not (fusion_aas_consumer or client_cluster):
basic_verification(ocs_registry_image)
if client_cluster:
verify_ocs_csv(ocs_registry_image=None)

# Verify pods in running state and proper counts
log.info("Verifying pod states and counts")
Expand Down Expand Up @@ -273,7 +275,7 @@ def ocs_install_verification(
}
)

if fusion_aas_consumer:
if fusion_aas_consumer or client_cluster:
del resources_dict[constants.OCS_OPERATOR_LABEL]
del resources_dict[constants.OPERATOR_LABEL]

Expand All @@ -292,7 +294,7 @@ def ocs_install_verification(
or disable_rgw
):
continue
if "noobaa" in label and (disable_noobaa or managed_service):
if "noobaa" in label and (disable_noobaa or managed_service or client_cluster):
continue
if "mds" in label and disable_cephfs:
continue
Expand Down Expand Up @@ -396,7 +398,7 @@ def ocs_install_verification(
csi_driver = OCP(kind="CSIDriver")
csi_drivers = {item["metadata"]["name"] for item in csi_driver.get()["items"]}
if not provider_cluster:
if fusion_aas_consumer:
if fusion_aas_consumer or client_cluster:
{
f"{namespace}.cephfs.csi.ceph.com",
f"{namespace}.rbd.csi.ceph.com",
Expand Down Expand Up @@ -430,7 +432,7 @@ def ocs_install_verification(
resource_name=constants.DEFAULT_STORAGECLASS_CEPHFS
)
if not disable_blockpools and not provider_cluster:
if consumer_cluster:
if consumer_cluster or client_cluster:
assert (
"rook-ceph-client"
in sc_rbd["parameters"]["csi.storage.k8s.io/node-stage-secret-name"]
Expand Down Expand Up @@ -473,7 +475,7 @@ def ocs_install_verification(
)

if not disable_cephfs and not provider_cluster:
if consumer_cluster:
if consumer_cluster or client_cluster:
assert (
"rook-ceph-client"
in sc_cephfs["parameters"]["csi.storage.k8s.io/node-stage-secret-name"]
Expand Down Expand Up @@ -517,7 +519,7 @@ def ocs_install_verification(
log.info("Verified node and provisioner secret names in storage class.")

# TODO: Enable the tools pod check when a solution is identified for tools pod on FaaS consumer
if not fusion_aas_consumer:
if not (fusion_aas_consumer or client_cluster):
ct_pod = get_ceph_tools_pod()

# https://github.com/red-hat-storage/ocs-ci/issues/3820
Expand Down Expand Up @@ -667,7 +669,7 @@ def ocs_install_verification(
# Let's wait for storage system after ceph health is OK to prevent fails on
# Progressing': 'True' state.

if not fusion_aas:
if not (fusion_aas or client_cluster):
verify_storage_system()

if config.ENV_DATA.get("fips"):
Expand All @@ -683,7 +685,7 @@ def ocs_install_verification(
if config.ENV_DATA.get("VAULT_CA_ONLY", None):
verify_kms_ca_only()

if not fusion_aas_consumer:
if not (fusion_aas_consumer or client_cluster):
storage_cluster_obj = get_storage_cluster()
is_flexible_scaling = (
storage_cluster_obj.get()["items"][0]
Expand Down Expand Up @@ -737,7 +739,7 @@ def ocs_install_verification(

# Verify olm.maxOpenShiftVersion property
# check ODF version due to upgrades
if ocs_version >= version.VERSION_4_14:
if ocs_version >= version.VERSION_4_14 and not hci_cluster:
verify_max_openshift_version()
if config.RUN["cli_params"].get("deploy") and not (
config.DEPLOYMENT["external_mode"]
Expand All @@ -756,10 +758,11 @@ def ocs_install_verification(
validate_serviceexport()

# check that noobaa root secrets are not public
assert (
check_if_mcg_root_secret_public() is False
), "Seems like MCG root secrets are public, please check"
log.info("Noobaa root secrets are not public")
if not client_cluster:
assert (
check_if_mcg_root_secret_public() is False
), "Seems like MCG root secrets are public, please check"
log.info("Noobaa root secrets are not public")


def mcg_only_install_verification(ocs_registry_image=None):
Expand Down

0 comments on commit b1370c4

Please sign in to comment.