Skip to content

Commit

Permalink
Merge pull request #402 from tisnik/adding-logging-to-the-olsconfig-c…
Browse files Browse the repository at this point in the history
…reation-failure

Adding logging to the olsconfig creation failure
  • Loading branch information
tisnik authored Feb 20, 2025
2 parents 237f846 + 31aef61 commit cf802f8
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions tests/e2e/utils/ols_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def replace_ols_image(ols_image: str) -> None:
)


def install_ols() -> tuple[str, str, str]: # pylint: disable=R0915
def install_ols() -> tuple[str, str, str]: # pylint: disable=R0915 # noqa: C901
"""Install OLS onto an OCP cluster using the OLS operator."""
print("Setting up for on cluster test execution")
is_konflux = os.getenv("KONFLUX_BOOL")
Expand Down Expand Up @@ -248,14 +248,27 @@ def install_ols() -> tuple[str, str, str]: # pylint: disable=R0915
except subprocess.CalledProcessError:
print("olsconfig does not yet exist. Creating it.")

cluster_utils.run_oc(
[
"create",
"-f",
f"tests/config/operator_install/olsconfig.crd.{provider}.yaml",
],
ignore_existing_resource=True,
)
crd_yml_name = f"olsconfig.crd.{provider}"
if os.getenv("INTROSPECTION_ENABLED", "n") == "y":
print("Cluster introspection is enabled.")
crd_yml_name += "_introspection"
try:
cluster_utils.run_oc(
[
"create",
"-f",
f"tests/config/operator_install/{crd_yml_name}.yaml",
],
ignore_existing_resource=True,
)
except subprocess.CalledProcessError as e:
csv = cluster_utils.run_oc(
["get", "clusterserviceversion", "-o", "jsonpath={.items[0].status}"]
)
print(
f"Error creating olsconfig: {e}, stdout: {e.output}, stderr: {e.stderr}, csv: {csv}"
)
raise
cluster_utils.run_oc(
[
"scale",
Expand Down

0 comments on commit cf802f8

Please sign in to comment.