Skip to content

Commit 14fc66d

Browse files
authored
Fix tekton test image extraction to use Konflux mirrors (#3984)
##### Short description: tekton test image kubevirt-tekton-tasks-tests was previously pulled from Brew. With the move to Konflux builds, the Brew path no longer hosts these images causing Tekton pipeline tests to fail during image extraction. These image carry pipeline definitions. ##### More details: we don't ship test-nvrs so they can never be part of external registry. Accessing them through konflux is only solution as discussed by CI team. ##### What this PR does / why we need it: small PR change to point to right konflux builds dynamically from ImageDigestMirrorSet resources on the cluster ##### Which issue(s) this PR fixes: ##### Special notes for reviewer: this will fix all tier3 lanes ##### jira-ticket: <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Refactored Tekton test setup to first derive image name and digest, then assemble a full image reference for extraction. * Switched resource extraction to use the new image reference for more reliable pulls. * Added stricter error handling and clearer diagnostics when CSV annotations or image discovery are missing. * Replaced the prior image-extraction flow with the new two-step construction for improved test reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a6b8e4b commit 14fc66d

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

tests/infrastructure/tekton/conftest.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
)
2626
from utilities.artifactory import get_artifactory_config_map, get_artifactory_secret
2727
from utilities.constants import (
28-
BREW_REGISTERY_SOURCE,
2928
OS_FLAVOR_FEDORA,
3029
TEKTON_AVAILABLE_PIPELINEREF,
3130
TEKTON_AVAILABLE_TASKS,
@@ -115,12 +114,20 @@ def csv_instance(csv_scope_session):
115114

116115

117116
@pytest.fixture(scope="session")
118-
def extracted_tekton_test_image(csv_instance):
119-
annotation = csv_instance.metadata.annotations.get("test-images-nvrs", "")
120-
for image in annotation.split(","):
121-
if KUBEVIRT_TEKTON_AVAILABLE_TASKS_TEST in image:
122-
return f"{BREW_REGISTERY_SOURCE}/rh-osbs/container-native-virtualization-{image.strip()}"
123-
raise ValueError("Tekton test image not found in CSV annotations.")
117+
def tekton_test_image_name_and_digest(csv_scope_session):
118+
test_images_nvrs = csv_scope_session.instance.metadata.annotations.get("test-images-nvrs")
119+
for test_image in test_images_nvrs.split(","):
120+
if KUBEVIRT_TEKTON_AVAILABLE_TASKS_TEST in test_image:
121+
return test_image.strip()
122+
raise ValueError(
123+
f"{KUBEVIRT_TEKTON_AVAILABLE_TASKS_TEST} not found in CSV 'test-images-nvrs' annotation: {test_images_nvrs}"
124+
)
125+
126+
127+
@pytest.fixture(scope="session")
128+
def tekton_test_image(tekton_test_image_name_and_digest, cnv_current_version):
129+
major, minor = cnv_current_version.split(".")[:2]
130+
return f"quay.io/openshift-virtualization/konflux-builds/v{major}-{minor}/{tekton_test_image_name_and_digest}"
124131

125132

126133
@pytest.fixture(scope="session")
@@ -132,11 +139,11 @@ def extracted_virtio_image_container(csv_instance):
132139

133140

134141
@pytest.fixture(scope="session")
135-
def extracted_kubevirt_tekton_resources(tekton_manifests_dir, extracted_tekton_test_image, generated_pulled_secret):
142+
def extracted_kubevirt_tekton_resources(tekton_manifests_dir, tekton_test_image, generated_pulled_secret):
136143
run_command(
137144
command=shlex.split(
138145
f"oc image extract --registry-config={generated_pulled_secret} "
139-
f"--path release/*:{tekton_manifests_dir} {extracted_tekton_test_image}"
146+
f"--path release/*:{tekton_manifests_dir} {tekton_test_image}"
140147
)
141148
)
142149

0 commit comments

Comments
 (0)