diff --git a/oci/mock-rock/_releases.json b/oci/mock-rock/_releases.json index dd757c2a..384f8f9a 100644 --- a/oci/mock-rock/_releases.json +++ b/oci/mock-rock/_releases.json @@ -21,7 +21,7 @@ "edge": { "target": "775" }, - "end-of-life": "2030-05-01T00:00:00Z" + "end-of-life": "2024-05-01T00:00:00Z" }, "test": { "beta": { @@ -35,34 +35,35 @@ "1.1-22.04": { "end-of-life": "2030-05-01T00:00:00Z", "candidate": { - "target": "776" + "target": "788" }, "beta": { - "target": "776" + "target": "788" }, "edge": { - "target": "776" + "target": "788" } }, "1-22.04": { "end-of-life": "2030-05-01T00:00:00Z", "candidate": { - "target": "776" + "target": "788" }, "beta": { - "target": "776" + "target": "788" }, "edge": { - "target": "776" + "target": "788" } }, "1.2-22.04": { "end-of-life": "2030-05-01T00:00:00Z", "beta": { - "target": "777" + "target": "789" }, "edge": { "target": "1.2-22.04_beta" } - } + }, + "1.0.0-22.04": {} } \ No newline at end of file diff --git a/oci/mock-rock/image.yaml b/oci/mock-rock/image.yaml index 362b45b0..72382b32 100644 --- a/oci/mock-rock/image.yaml +++ b/oci/mock-rock/image.yaml @@ -13,14 +13,8 @@ upload: commit: 17916dd5de270e61a6a3fd3f4661a6413a50fd6f directory: mock_rock/1.0 release: - 1.0.0-22.04: - end-of-life: "2024-05-01T00:00:00Z" - risks: - - candidate - - edge - - beta 1.0-22.04: - end-of-life: "2030-05-01T00:00:00Z" + end-of-life: "2024-05-01T00:00:00Z" risks: - candidate - edge diff --git a/src/docs/generate_oci_doc_yaml.py b/src/docs/generate_oci_doc_yaml.py index 49802154..e4b7ebe4 100755 --- a/src/docs/generate_oci_doc_yaml.py +++ b/src/docs/generate_oci_doc_yaml.py @@ -14,6 +14,7 @@ import sys import tempfile from typing import Any, Dict, List +from datetime import datetime, timezone from dateutil import parser import boto3 @@ -268,6 +269,11 @@ def build_releases_data( eol = parser.parse(all_tracks[track_base]) release_data["support"] = {"until": eol.strftime("%m/%Y")} + if eol < datetime.now(timezone.utc): + release_data["deprecated"] = { + "date": eol.strftime("%m/%Y") + } + releases.append(release_data) return releases diff --git a/src/image/release.py b/src/image/release.py index f7862e0b..1ba19e0e 100755 --- a/src/image/release.py +++ b/src/image/release.py @@ -94,6 +94,16 @@ print(f"Channel {tag} points to {value}") tag_mapping_from_trigger[tag] = value +# update EOL dates from upload dictionary +for upload in image_trigger["upload"] or []: + for track, upload_release_dict in (upload["release"] or {}).items(): + if track not in all_releases: + print(f"Track {track} will be created for the 1st time") + all_releases[track] = {} + + if isinstance(upload_release_dict, dict) and "end-of-life" in upload_release_dict: + all_releases[track]["end-of-life"] = upload_release_dict["end-of-life"] + print( "Going to update channels according to the following:\n" f"{json.dumps(tag_mapping_from_trigger, indent=2)}"