Skip to content

Commit 7a20c43

Browse files
committed
Show all imagestreams in imagestream file
This fixes PR #256 Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent 741a503 commit 7a20c43

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

check_imagestreams.py

+16
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ def check_imagestreams(self) -> int:
9797
print("Imagestreams contains the latest version.")
9898
return 0
9999

100+
def show_all_imagestreams(self):
101+
p = Path(".")
102+
json_files = p.glob(f"{IMAGESTREAMS_DIR}/*.json")
103+
if not json_files:
104+
print(f"No json files present in {IMAGESTREAMS_DIR}.")
105+
return 0
106+
for f in json_files:
107+
if os.environ.get("TARGET") in ("rhel7", "centos7") and "aarch64" in str(f):
108+
print("Imagestream aarch64 is not supported on rhel7")
109+
continue
110+
json_dict = self.load_json_file(f)
111+
print(f"Tags in the image stream {f}:")
112+
for tag in json_dict["spec"]["tags"]:
113+
print(f"- {tag['name']} -> {tag['from']['name']}")
114+
100115

101116
if __name__ == "__main__":
102117
if len(sys.argv) != 2:
@@ -105,4 +120,5 @@ def check_imagestreams(self) -> int:
105120

106121
print(f"Version to check is {sys.argv[1]}.")
107122
isc = ImageStreamChecker(version=sys.argv[1])
123+
isc.show_all_imagestreams()
108124
sys.exit(isc.check_imagestreams())

tests/check_imagestreams.sh

+4
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ check_imagestreams=$(dirname "$(readlink -f "$0")")/../check_imagestreams.py
77
test $? -eq 1
88
"${PYTHON-python3}" "$check_imagestreams" "2.4"
99
test $? -eq 0
10+
echo "Check full is output"
11+
output=$("${PYTHON-python3}" "$check_imagestreams" "2.4")
12+
test "${output#*"- latest -> 2.4"}" != "$output" && echo "latest found in the output"
13+
test "${output#*"- 2.4 -> registry.redhat.io/rhscl/httpd-24-rhel7"}" != "$output" && echo "2.4 found in the output"

0 commit comments

Comments
 (0)