-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added mce.py file for mce installation related methods #11038
base: master
Are you sure you want to change the base?
Added mce.py file for mce installation related methods #11038
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: amr1ta The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -477,6 +488,8 @@ def deploy_dependencies( | |||
self.deploy_lb() | |||
if download_hcp_binary: | |||
self.update_hcp_binary() | |||
if deploy_mce: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably check, if deploy_acm_hub: True, leaving ACM as a general option
if deploy_mce: | |
if deploy_mce and not deploy_acm_hub: |
Creates a catalogsource for mce operator. | ||
|
||
""" | ||
logger.info("Adding CatalogSource for MCE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to check if MCE catalogSource is not already installed. This way we insure, the Deployment can be rerun again from any installation stage.
In opposite if we do not do this check, job will abort with error
Raises: | ||
CommandFailed: If the 'oc create' command fails. | ||
""" | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to check if resource exist than using try-except, to not pollute logs with false-errors
""" | ||
operatorgroup_yaml_file = templating.load_yaml(constants.MCE_OPERATOR_YAM) | ||
operatorgroup_yaml = OCS(**operatorgroup_yaml_file) | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to check if resource exist than using try-except, to not pollute logs with false-errors
mce_subscription_yaml_data, mce_subscription_manifest.name | ||
) | ||
logger.info("Creating subscription for mce operator") | ||
run_cmd(f"oc create -f {mce_subscription_manifest.name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check if subscription exists in the beginning of the method; if exists skip execution of the method
"-n {self.namespace}" | ||
) | ||
cmd_res = exec_cmd(cmd, shell=True) | ||
assert cmd_res.returncode == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall it its better not use assert in deployments, but in tests. This way we'll have errors in log showing that deployment failed, instead of assertion signaling about a product bug
"]}}}' --type=merge" | ||
) | ||
cmd_res = exec_cmd(cmd, shell=True) | ||
assert cmd_res.returncode == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, assertion on this would not mean Product bug;
we have module with ocs-ci exceptions ocs_ci.ocs.exceptions
, please use existing or add another with description
namespace=constants.HYPERSHIFT_NAMESPACE, | ||
) | ||
|
||
assert configmaps_obj.is_exist( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have module with ocs-ci exceptions ocs_ci.ocs.exceptions
, please use existing or add another with description instead of using assert
@@ -386,6 +390,7 @@ def deploy_ocp( | |||
deploy_acm_hub=True, | |||
deploy_metallb=True, | |||
download_hcp_binary=True, | |||
deploy_mce=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will need introduce this new parameter in configurations and .md file.
…btest to check mce installation and hcp cluster creation without acm operator Signed-off-by: Amrita Mahapatra <[email protected]>
Signed-off-by: Amrita Mahapatra <[email protected]>
65086be
to
a42dd98
Compare
Signed-off-by: Amrita Mahapatra <[email protected]>
a42dd98
to
d372a22
Compare
Added mce.py file for mce installation related methods and created libtest to check mce installation and hcp cluster creation without acm operator