Skip to content

Commit

Permalink
Update OCP check script and upstream support with the prow changes
Browse files Browse the repository at this point in the history
The PROW CI jobs were updated to use only latest OCP release for their
runs. The documentation and the check openshift version script needs
to be changed as well.

PROW PR: openshift/release#44348

Signed-off-by: Michal Pryc <[email protected]>
  • Loading branch information
mpryc committed Oct 13, 2023
1 parent a7302b4 commit 1c76e0c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/UpstreamSupport.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Pelorus Upstream Support Statement

The Pelorus engineering team will provide **best-effort** level support for it on the currently latest and the latest 3 previous released stable minor versions of OpenShift version 4.
The Pelorus engineering team will provide **best-effort** level support for it on the currently latest released stable minor versions of the OpenShift version 4.

> **NOTE:** Pelorus is currently automated tested against versions **4.10**, **4.11**, **4.12** and **4.13** of OpenShift.
> **NOTE:** Pelorus is currently automated tested against version **4.13** of OpenShift.
* To file a bug, please create a [Bug issue](https://github.com/dora-metrics/pelorus/issues/new?assignees=&labels=kind%2Fbug%2Cneeds-triage&template=bug.yml)

Expand Down
16 changes: 11 additions & 5 deletions scripts/check_openshift_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
OPENSHIFT_BRANCH = "master"
RAW_URL = f"https://raw.githubusercontent.com/{OPENSHIFT_REPO}/{OPENSHIFT_BRANCH}"

OCP_CI_VERSION_URL = "https://openshift-release.apps.ci.l2s4.p1.openshiftapps.com/graph"
NO_LAST_OCP_VERSIONS = 1


def get_supported_versions() -> List[str]:
with request.urlopen(
"https://openshift-release.apps.ci.l2s4.p1.openshiftapps.com/graph"
) as response:
with request.urlopen(OCP_CI_VERSION_URL) as response:
versions: List[Dict[str, str]] = list(json.load(response)["nodes"])
stable_versions = [
version["version"]
Expand All @@ -44,7 +45,10 @@ def get_supported_versions() -> List[str]:
latest_minor_versions = list(minor_versions)
latest_minor_versions.sort(reverse=True)

return [f"{version.major}.{version.minor}" for version in latest_minor_versions[:4]]
return [
f"{version.major}.{version.minor}"
for version in latest_minor_versions[:NO_LAST_OCP_VERSIONS]
]


def check_version_in_openshift_repo(version: str, file_name: str) -> None:
Expand Down Expand Up @@ -86,7 +90,9 @@ def check_versions(versions: List[str]) -> None:

def main() -> None:
supported_versions = get_supported_versions()
logging.info(f"Latest minor OpenShift releases: {', '.join(supported_versions)}")
logging.info(
f"Last '{NO_LAST_OCP_VERSIONS}' minor OpenShift release(s): {', '.join(supported_versions)}"
)
check_versions(supported_versions)

log_cache: dict = logging.getLogger()._cache
Expand Down

0 comments on commit 1c76e0c

Please sign in to comment.