Skip to content

Commit 7d89ca0

Browse files
authored
Merge branch 'main' into testCustomCliDownload
2 parents ec5749c + 5a53492 commit 7d89ca0

8 files changed

Lines changed: 40 additions & 34 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
stages: [pre-commit]
1414

1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.13.1
16+
rev: v0.13.2
1717
hooks:
1818
- id: ruff
1919
stages: [pre-commit]

OWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ reviewers:
88
- vsibirsk
99
- dshchedr
1010
- rnetser
11+
emeritus_approvers:
12+
- dbasunag # 2025-03-10

docs/OWNERS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Taken from [Kubernetes OWNERS guide](https://www.kubernetes.dev/docs/guide/owners/#owners)
2+
3+
# OWNERS files
4+
Each directory that contains a unit of independent code or content may also contain an OWNERS file. This file applies to everything within the directory, including the OWNERS file itself, sibling files, and child directories.
5+
6+
OWNERS files are in YAML format and support the following keys:
7+
8+
- approvers: a list of GitHub usernames or aliases that can /approve a PR.
9+
- reviewers: a list of GitHub usernames or aliases that are good candidates to /lgtm a PR.
10+
- emeritus_approvers a list of GitHub usernames of folks who were previously in the approvers section, but are no longer actively approving code.

tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from ocp_resources.cluster_service_version import ClusterServiceVersion
3232
from ocp_resources.config_map import ConfigMap
3333
from ocp_resources.daemonset import DaemonSet
34+
from ocp_resources.data_source import DataSource
3435
from ocp_resources.datavolume import DataVolume
3536
from ocp_resources.deployment import Deployment
3637
from ocp_resources.hostpath_provisioner import HostPathProvisioner
@@ -105,6 +106,7 @@
105106
POD_SECURITY_NAMESPACE_LABELS,
106107
PREFERENCE_STR,
107108
RHEL9_PREFERENCE,
109+
RHEL9_STR,
108110
RHEL_WITH_INSTANCETYPE_AND_PREFERENCE,
109111
RHSM_SECRET_NAME,
110112
SSP_CR_COMMON_TEMPLATES_LIST_KEY_NAME,
@@ -899,6 +901,16 @@ def golden_image_data_source_scope_function(admin_client, golden_image_data_volu
899901
yield from create_or_update_data_source(admin_client=admin_client, dv=golden_image_data_volume_scope_function)
900902

901903

904+
@pytest.fixture(scope="module")
905+
def rhel9_data_source_scope_module(golden_images_namespace):
906+
return DataSource(
907+
client=golden_images_namespace.client,
908+
name=RHEL9_STR,
909+
namespace=golden_images_namespace.name,
910+
ensure_exists=True,
911+
)
912+
913+
902914
"""
903915
VM creation from template
904916
"""

tests/infrastructure/golden_images/update_boot_source/test_ssp_common_templates_boot_sources.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
assert_missing_golden_image_pvc,
1212
assert_os_version_mismatch_in_vm,
1313
)
14-
from utilities.constants import TIMEOUT_5MIN, TIMEOUT_5SEC, Images
14+
from utilities.constants import RHEL9_STR, TIMEOUT_5MIN, TIMEOUT_5SEC, Images
1515
from utilities.infra import (
1616
cleanup_artifactory_secret_and_config_map,
1717
get_artifactory_config_map,
@@ -21,7 +21,6 @@
2121
from utilities.virt import VirtualMachineForTestsFromTemplate, running_vm
2222

2323
LOGGER = logging.getLogger(__name__)
24-
RHEL9_NAME = "rhel9"
2524

2625

2726
@pytest.fixture()
@@ -37,14 +36,6 @@ def matrix_data_source(auto_update_data_source_matrix__function__, golden_images
3736
)
3837

3938

40-
@pytest.fixture()
41-
def rhel9_data_source(golden_images_namespace):
42-
return DataSource(
43-
name=RHEL9_NAME,
44-
namespace=golden_images_namespace.name,
45-
)
46-
47-
4839
@pytest.fixture()
4940
def existing_data_source_volume(
5041
admin_client,
@@ -85,13 +76,13 @@ def auto_update_boot_source_vm(
8576

8677

8778
@pytest.fixture()
88-
def vm_without_boot_source(unprivileged_client, namespace, rhel9_data_source):
79+
def vm_without_boot_source(unprivileged_client, namespace, rhel9_data_source_scope_module):
8980
with VirtualMachineForTestsFromTemplate(
90-
name=f"{rhel9_data_source.name}-vm",
81+
name=f"{rhel9_data_source_scope_module.name}-vm",
9182
namespace=namespace.name,
9283
client=unprivileged_client,
9384
labels=template_labels(os="rhel9.0"),
94-
data_source=rhel9_data_source,
85+
data_source=rhel9_data_source_scope_module,
9586
non_existing_pvc=True,
9687
) as vm:
9788
vm.start()
@@ -100,28 +91,28 @@ def vm_without_boot_source(unprivileged_client, namespace, rhel9_data_source):
10091

10192

10293
@pytest.fixture()
103-
def opted_out_rhel9_data_source(rhel9_data_source):
104-
LOGGER.info(f"Wait for DataSource {rhel9_data_source.name} to opt out")
94+
def opted_out_rhel9_data_source(rhel9_data_source_scope_module):
95+
LOGGER.info(f"Wait for DataSource {rhel9_data_source_scope_module.name} to opt out")
10596
try:
10697
for sample in TimeoutSampler(
10798
wait_timeout=TIMEOUT_5MIN,
10899
sleep=TIMEOUT_5SEC,
109-
func=lambda: rhel9_data_source.source.name == RHEL9_NAME,
100+
func=lambda: rhel9_data_source_scope_module.source.name == RHEL9_STR,
110101
):
111102
if sample:
112103
return
113104
except TimeoutExpiredError:
114-
LOGGER.error(f"{rhel9_data_source.name} DataSource source was not updated.")
105+
LOGGER.error(f"{rhel9_data_source_scope_module.name} DataSource source was not updated.")
115106
raise
116107

117108

118109
@pytest.fixture()
119-
def rhel9_dv(admin_client, golden_images_namespace, rhel9_data_source, rhel9_http_image_url):
110+
def rhel9_dv(admin_client, golden_images_namespace, rhel9_data_source_scope_module, rhel9_http_image_url):
120111
artifactory_secret = get_artifactory_secret(namespace=golden_images_namespace.name)
121112
artifactory_config_map = get_artifactory_config_map(namespace=golden_images_namespace.name)
122113
with DataVolume(
123114
client=admin_client,
124-
name=rhel9_data_source.source.name,
115+
name=rhel9_data_source_scope_module.source.name,
125116
namespace=golden_images_namespace.name,
126117
url=rhel9_http_image_url,
127118
secret=artifactory_secret,

tests/install_upgrade_operators/product_install/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"kubevirt-hyperconverged-",
3737
"olm.og.openshift-cnv-",
3838
"kubevirt-ipam-controller-manager-role",
39+
"kubevirt-synchronization-controller",
3940
],
4041
"ClusterRoleBinding": [
4142
"hostpath-provisioner-operator-service-system:auth-delegator",
@@ -57,6 +58,8 @@
5758
"template-validator",
5859
"kubevirt-hyperconverged-",
5960
"olm.og.openshift-cnv-kubevirt-ipam-controller-manager-rolebinding",
61+
"kubevirt-synchronization-controller",
62+
"kubevirt-ipam-controller-manager-rolebinding",
6063
],
6164
"Namespace": ["openshift-cnv", "openshift-virtualization-os-images"],
6265
"Project": ["openshift-cnv", "openshift-virtualization-os-images"],

tests/storage/golden_image/test_cached_snapshots.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
from benedict import benedict
66
from kubernetes.dynamic.exceptions import ResourceNotFoundError
77
from ocp_resources.data_import_cron import DataImportCron
8-
from ocp_resources.data_source import DataSource
98
from ocp_resources.datavolume import DataVolume
109
from ocp_resources.persistent_volume_claim import PersistentVolumeClaim
1110
from ocp_resources.storage_profile import StorageProfile
1211
from ocp_resources.volume_snapshot import VolumeSnapshot
1312

1413
from tests.os_params import RHEL_LATEST_LABELS
15-
from utilities.constants import DATA_IMPORT_CRON_ENABLE, TIMEOUT_3MIN
14+
from utilities.constants import DATA_IMPORT_CRON_ENABLE, RHEL9_STR, TIMEOUT_3MIN
1615
from utilities.hco import (
1716
disable_common_boot_image_import_hco_spec,
1817
update_hco_templates_spec,
@@ -32,7 +31,6 @@
3231
pytestmark = pytest.mark.usefixtures(
3332
"skip_if_no_storage_profile_with_snapshot_import_cron_format",
3433
)
35-
RHEL9_STR = "rhel9"
3634

3735

3836
def get_rhel9_data_import_cron_template(common_templates):
@@ -121,17 +119,6 @@ def updated_rhel9_boot_source(
121119
).clean_up()
122120

123121

124-
@pytest.fixture(scope="module")
125-
def rhel9_data_source_scope_module(golden_images_namespace):
126-
data_source = DataSource(
127-
name=RHEL9_STR,
128-
namespace=golden_images_namespace.name,
129-
)
130-
if data_source.exists:
131-
return data_source
132-
raise ResourceNotFoundError(f"{RHEL9_STR} DataImportCron should exist in the cluster")
133-
134-
135122
@pytest.fixture(scope="module")
136123
def rhel9_boot_source_name(rhel9_data_source_scope_module):
137124
return rhel9_data_source_scope_module.source.name

utilities/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ class S390X:
394394
CREATING_VIRTUAL_MACHINE_FROM_VOLUME = "creating-virtual-machine-from-volume"
395395
UPLOAD_BOOT_SOURCE = "upload-boot-source"
396396
GRAFANA_DASHBOARD_KUBEVIRT_TOP_CONSUMERS = "grafana-dashboard-kubevirt-top-consumers"
397+
RHEL9_STR = "rhel9"
397398
RHEL8_GUEST = "rhel8-guest"
398399
RHEL9_GUEST = "rhel9-guest"
399400
RHEL10_GUEST = "rhel10-guest"

0 commit comments

Comments
 (0)