-
Notifications
You must be signed in to change notification settings - Fork 72
infra: Update dv_for_data_source to create the dv from public quay #5592
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,17 +17,11 @@ | |
| PVC_NOT_FOUND_ERROR, | ||
| ) | ||
| from tests.utils import get_parameters_from_template | ||
| from utilities.artifactory import ( | ||
| cleanup_artifactory_secret_and_config_map, | ||
| get_artifactory_config_map, | ||
| get_artifactory_secret, | ||
| get_http_image_url, | ||
| ) | ||
| from utilities.constants import Images | ||
| from utilities.constants.hco import DATA_SOURCE_NAME | ||
| from utilities.constants.images import DEFAULT_FEDORA_REGISTRY_URL | ||
| from utilities.constants.pytest import QUARANTINED | ||
| from utilities.constants.storage import BIND_IMMEDIATE_ANNOTATION | ||
| from utilities.constants.storage import BIND_IMMEDIATE_ANNOTATION, REGISTRY_STR | ||
| from utilities.constants.timeouts import ( | ||
| TIMEOUT_5MIN, | ||
| TIMEOUT_10MIN, | ||
|
|
@@ -47,20 +41,13 @@ | |
|
|
||
| @contextmanager | ||
| def dv_for_data_source(name, data_source, admin_client): | ||
| artifactory_secret = get_artifactory_secret(namespace=data_source.namespace) | ||
| artifactory_config_map = get_artifactory_config_map(namespace=data_source.namespace) | ||
| with DataVolume( | ||
| client=admin_client, | ||
| name=name, | ||
| namespace=data_source.namespace, | ||
| source_dict=construct_datavolume_source_dict( | ||
| # underlying OS is not relevant | ||
| source="http", | ||
| url=get_http_image_url(image_directory=Images.Cirros.DIR, image_name=Images.Cirros.QCOW2_IMG), | ||
| secret_name=artifactory_secret.name, | ||
| cert_configmap_name=artifactory_config_map.name, | ||
| ), | ||
| size=Images.Cirros.DEFAULT_DV_SIZE, | ||
| # underlying OS is not relevant | ||
| source_dict=construct_datavolume_source_dict(source=REGISTRY_STR, url=DEFAULT_FEDORA_REGISTRY_URL), | ||
| size=Images.Fedora.DEFAULT_DV_SIZE, | ||
| storage_class=py_config["default_storage_class"], | ||
| annotations=BIND_IMMEDIATE_ANNOTATION, | ||
| api_name="storage", | ||
|
|
@@ -71,9 +58,6 @@ def dv_for_data_source(name, data_source, admin_client): | |
| expected_message=DATA_SOURCE_READY_FOR_CONSUMPTION_MESSAGE, | ||
| ) | ||
| yield dv | ||
| cleanup_artifactory_secret_and_config_map( | ||
| artifactory_secret=artifactory_secret, artifactory_config_map=artifactory_config_map | ||
| ) | ||
|
|
||
|
|
||
| def opt_in_status_str(opt_in): | ||
|
|
@@ -100,7 +84,7 @@ def wait_for_data_source_reconciliation_after_update( | |
| def wait_for_data_source_unchanged_referenced_volume(data_source, volume_name): | ||
| try: | ||
| for sample in TimeoutSampler( | ||
| wait_timeout=TIMEOUT_10MIN, | ||
| wait_timeout=TIMEOUT_5MIN, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait_for_data_source_unchanged_referenced_volume is only used at one place under test_data_source_with_existing_golden_image_pvc.
wait_for_condition_message_value waits for ready message which means it's stable so instead of wait_for_data_source_unchanged_referenced_volume , which is another wait , should we directly assert? wait_for_data_source_unchanged_referenced_volume will keep polling for 5 mins even if we get what we want . why we expect something would change in that 5 mins because everything is already stable when we run wait_for_data_source_unchanged_referenced_volume |
||
| sleep=5, | ||
| func=lambda: data_source.source.name != volume_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.
Wouldn't it be better to clone from a golden image to reduce the dependency on quay?
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.
You mean from a
DataSource?It's not possible, the test idea is to create a DV while the boot sources are down, and then to bring them up again after the PVC is created.
So there no source to clone from when creating the DV.