Skip to content

Commit

Permalink
Add check for dependent operator
Browse files Browse the repository at this point in the history
Signed-off-by: Tarun Kumar <[email protected]>
  • Loading branch information
tarukumar committed Dec 14, 2023
1 parent 51b27ad commit bf52697
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 20 deletions.
50 changes: 30 additions & 20 deletions ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot
Original file line number Diff line number Diff line change
Expand Up @@ -293,23 +293,33 @@ Install Kserve Dependencies
Set Suite Variable ${FILES_RESOURCES_DIRPATH} tests/Resources/Files
Set Suite Variable ${SUBSCRIPTION_YAML_TEMPLATE_FILEPATH} ${FILES_RESOURCES_DIRPATH}/isv-operator-subscription.yaml
Set Suite Variable ${OPERATORGROUP_YAML_TEMPLATE_FILEPATH} ${FILES_RESOURCES_DIRPATH}/isv-operator-group.yaml
Install ISV Operator From OperatorHub Via CLI operator_name=${SERVICEMESH_OP_NAME}
... subscription_name=${SERVICEMESH_SUB_NAME}
... catalog_source_name=redhat-operators
Wait Until Operator Subscription Last Condition Is
... type=CatalogSourcesUnhealthy status=False
... reason=AllCatalogSourcesHealthy subcription_name=${SERVICEMESH_SUB_NAME}
${rc} ${out}= Run And Return Rc And Output oc create namespace ${SERVERLESS_NS}
Install ISV Operator From OperatorHub Via CLI operator_name=${SERVERLESS_OP_NAME}
... namespace=${SERVERLESS_NS}
... subscription_name=${SERVERLESS_SUB_NAME}
... catalog_source_name=redhat-operators
... operator_group_name=serverless-operators
... operator_group_ns=${SERVERLESS_NS}
... operator_group_target_ns=${NONE}
Wait For Pods To Be Ready label_selector=name=knative-openshift
... namespace=${SERVERLESS_NS}
Wait For Pods To Be Ready label_selector=name=knative-openshift-ingress
... namespace=${SERVERLESS_NS}
Wait For Pods To Be Ready label_selector=name=knative-operator
... namespace=${SERVERLESS_NS}
${is_installed}= Check If Operator Is Installed Via CLI servicemeshoperators

Check warning

Code scanning / Robocop

The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning

The assignment sign is not consistent within the file. Expected ' =' but got '=' instead
IF not ${is_installed}
Install ISV Operator From OperatorHub Via CLI operator_name=${SERVICEMESH_OP_NAME}
... subscription_name=${SERVICEMESH_SUB_NAME}
... catalog_source_name=redhat-operators
Wait Until Operator Subscription Last Condition Is
... type=CatalogSourcesUnhealthy status=False
... reason=AllCatalogSourcesHealthy subcription_name=${SERVICEMESH_SUB_NAME}
ELSE
Log To Console message=ServiceMesh Operator is already installed
END
${is_installed}= Check If Operator Is Installed Via CLI serverless-operators

Check warning

Code scanning / Robocop

The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning

The assignment sign is not consistent within the file. Expected ' =' but got '=' instead
IF not ${is_installed}
${rc} ${out}= Run And Return Rc And Output oc create namespace ${SERVERLESS_NS}

Check warning

Code scanning / Robocop

The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning

The assignment sign is not consistent within the file. Expected ' =' but got '=' instead
Install ISV Operator From OperatorHub Via CLI operator_name=${SERVERLESS_OP_NAME}
... namespace=${SERVERLESS_NS}
... subscription_name=${SERVERLESS_SUB_NAME}
... catalog_source_name=redhat-operators
... operator_group_name=serverless-operators
... operator_group_ns=${SERVERLESS_NS}
... operator_group_target_ns=${NONE}
Wait For Pods To Be Ready label_selector=name=knative-openshift
... namespace=${SERVERLESS_NS}
Wait For Pods To Be Ready label_selector=name=knative-openshift-ingress
... namespace=${SERVERLESS_NS}
Wait For Pods To Be Ready label_selector=name=knative-operator
... namespace=${SERVERLESS_NS}
ELSE
Log To Console message=Serverless Operator is already installed

Check warning

Code scanning / Robocop

{{ bad_indent_msg }} Warning

Line is under-indented
END
12 changes: 12 additions & 0 deletions ods_ci/tests/Resources/Page/Operators/ISVs.resource
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,15 @@ Uninstall ISV Operator From OperatorHub Via CLI
... oc get subscription ${subscription_name} -n ${namespace} -ojson | jq '.status.currentCSV' | tr -d '"' # robocop: disable
Oc Delete kind=Subscription name=${subscription_name} namespace=${namespace}
Oc Delete kind=ClusterServiceVersion name=${current_csv_name} namespace=${namespace}

Check If Operator Is Installed Via CLI
[Documentation] Check If Operator Is Installed Via CLI and Return the Status
[Arguments] ${operator_name}
${rc} ${out}= Run And Return Rc And Output

Check notice

Code scanning / Robocop

Variable '{{ name }}' is assigned but not used Note test

Variable '${rc}' is assigned but not used
... oc get subscriptions.operators.coreos.com --all-namespaces -o custom-columns="PACKAGE:.spec.name" | awk '$1 == "${operator_name}"' # robocop: disable
${status} Run Keyword And Return Status Should Not Be Empty ${out}

Check warning

Code scanning / Robocop

The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning test

The assignment sign is not consistent within the file. Expected '=' but got '' instead
IF ${status}
RETURN True
ELSE
RETURN False
END

0 comments on commit bf52697

Please sign in to comment.