Skip to content

Commit

Permalink
Omit version tags
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Mazzotti <[email protected]>
  • Loading branch information
anmazzotti committed Jun 3, 2024
1 parent 32973dc commit 446a015
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 175 deletions.
52 changes: 0 additions & 52 deletions channels/sle-micro-5-5.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
[
{
"metadata": {
"name": "v2.0.2"
},
"spec": {
"version": "v2.0.2",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.111",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.102"
Expand Down Expand Up @@ -220,19 +207,6 @@
}
}
},
{
"metadata": {
"name": "v2.0.4"
},
"spec": {
"version": "v2.0.4",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.4-5.5.24",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.4-5.5.15"
Expand Down Expand Up @@ -285,19 +259,6 @@
}
}
},
{
"metadata": {
"name": "v2.0.2"
},
"spec": {
"version": "v2.0.2",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sle-micro-iso/5.5:2.0.2-4.2.128",
"displayName": "SLE Micro 5.5 ISO"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.128"
Expand Down Expand Up @@ -337,19 +298,6 @@
}
}
},
{
"metadata": {
"name": "v2.0.4"
},
"spec": {
"version": "v2.0.4",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sle-micro-iso/5.5:2.0.4-5.5.20",
"displayName": "SLE Micro 5.5 ISO"
}
}
},
{
"metadata": {
"name": "v2.0.4-5.5.20"
Expand Down
52 changes: 0 additions & 52 deletions channels/sle-micro-base-5-5.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
[
{
"metadata": {
"name": "base-v2.0.2"
},
"spec": {
"version": "v2.0.2",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/base-5.5:2.0.2-5.5.12",
"displayName": "SLE Micro Base 5.5 OS"
}
}
},
{
"metadata": {
"name": "base-v2.0.2-4.2.16"
Expand Down Expand Up @@ -129,19 +116,6 @@
}
}
},
{
"metadata": {
"name": "base-v2.0.4"
},
"spec": {
"version": "v2.0.4",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/base-5.5:2.0.4-5.8.9",
"displayName": "SLE Micro Base 5.5 OS"
}
}
},
{
"metadata": {
"name": "base-v2.0.4-5.8.1"
Expand Down Expand Up @@ -181,19 +155,6 @@
}
}
},
{
"metadata": {
"name": "base-v2.0.2"
},
"spec": {
"version": "v2.0.2",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sle-micro-iso/base-5.5:2.0.2-4.2.203",
"displayName": "SLE Micro Base 5.5 ISO"
}
}
},
{
"metadata": {
"name": "base-v2.0.2-4.2.156"
Expand Down Expand Up @@ -233,19 +194,6 @@
}
}
},
{
"metadata": {
"name": "base-v2.0.4"
},
"spec": {
"version": "v2.0.4",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sle-micro-iso/base-5.5:2.0.4-5.5.29",
"displayName": "SLE Micro Base 5.5 ISO"
}
}
},
{
"metadata": {
"name": "base-v2.0.4-5.5.29"
Expand Down
26 changes: 0 additions & 26 deletions channels/sle-micro-kvm-5-5.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
[
{
"metadata": {
"name": "kvm-v2.0.2"
},
"spec": {
"version": "v2.0.2",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/kvm-5.5:2.0.2-2.2.115",
"displayName": "SLE Micro KVM 5.5 OS"
}
}
},
{
"metadata": {
"name": "kvm-v2.0.2-2.2.115"
Expand Down Expand Up @@ -51,19 +38,6 @@
}
}
},
{
"metadata": {
"name": "kvm-v2.0.4"
},
"spec": {
"version": "v2.0.4",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/kvm-5.5:2.0.4-3.5.19",
"displayName": "SLE Micro KVM 5.5 OS"
}
}
},
{
"metadata": {
"name": "kvm-v2.0.4-3.5.19"
Expand Down
32 changes: 3 additions & 29 deletions channels/sle-micro-rt-5-5.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
[
{
"metadata": {
"name": "rt-v2.0.2"
},
"spec": {
"version": "v2.0.2",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/rt-5.5:",
"displayName": "SLE Micro RT 5.5 OS"
}
}
},
{
"metadata": {
"name": "rt-v2.0.2-3.2.119"
Expand All @@ -20,7 +7,7 @@
"version": "v2.0.2-3.2.119",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/rt-5.5:",
"upgradeImage": "registry.suse.com/suse/sle-micro/rt-5.5:2.0.2-3.2.119",
"displayName": "SLE Micro RT 5.5 OS"
}
}
Expand All @@ -33,7 +20,7 @@
"version": "v2.0.2-3.2.23",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/rt-5.5:",
"upgradeImage": "registry.suse.com/suse/sle-micro/rt-5.5:2.0.2-3.2.23",
"displayName": "SLE Micro RT 5.5 OS"
}
}
Expand All @@ -46,20 +33,7 @@
"version": "v2.0.2-3.2.86",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/rt-5.5:",
"displayName": "SLE Micro RT 5.5 OS"
}
}
},
{
"metadata": {
"name": "rt-v2.0.4"
},
"spec": {
"version": "v2.0.4",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/rt-5.5:2.0.4-4.5.21",
"upgradeImage": "registry.suse.com/suse/sle-micro/rt-5.5:2.0.2-3.2.86",
"displayName": "SLE Micro RT 5.5 OS"
}
}
Expand Down
26 changes: 10 additions & 16 deletions refresh_channels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ function append_iso_entry() {
EOF
}

# Return the 'org.opencontainers.image.version' label value
#
# This value should always point to the latest build version tag.
# Ex. '2.0.2-4.2.102' instead of '2.0.2'
function fetch_build_tag() {
local repo=$1
local tag=$2

local build_tag=($(skopeo inspect docker://$repo:$tag | jq '.Labels["org.opencontainers.image.version"]' | sed 's/"//g'))
echo "$build_tag"
}

watches=$(yq e -o=j -I=0 '.watches[]' config.yaml)

# Loop through all watches
Expand All @@ -92,18 +80,24 @@ while IFS=\= read watch; do
# Process OS container tags
os_tags=($(skopeo list-tags docker://$os_repo | jq '.Tags[]' | grep -v '.att\|.sig\|latest' | sed 's/"//g'))
for tag in "${os_tags[@]}"; do
# Omit version (non-build) tags
if [[ $tag =~ ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$ ]]; then
continue
fi
managed_os_version_name=$(format_managed_os_version_name "$flavor" "$tag")
build_tag=$(fetch_build_tag "$os_repo" "$tag")
append_os_entry "$file" "$managed_os_version_name" "$tag" "$os_repo:$build_tag" "$display_name OS"
append_os_entry "$file" "$managed_os_version_name" "$tag" "$os_repo:$tag" "$display_name OS"
done

# Process ISO container tags (if applicable)
if [ "$iso_repo" != "N/A" ]; then
iso_tags=($(skopeo list-tags docker://$iso_repo | jq '.Tags[]' | grep -v '.att\|.sig\|latest' | sed 's/"//g'))
for tag in "${iso_tags[@]}"; do
# Omit version (non-build) tags
if [[ $tag =~ ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$ ]]; then
continue
fi
managed_os_version_name=$(format_managed_os_version_name "$flavor" "$tag")
build_tag=$(fetch_build_tag "$iso_repo" "$tag")
append_iso_entry "$file" "$managed_os_version_name" "$tag" "$iso_repo:$build_tag" "$display_name ISO"
append_iso_entry "$file" "$managed_os_version_name" "$tag" "$iso_repo:$tag" "$display_name ISO"
done
fi

Expand Down

0 comments on commit 446a015

Please sign in to comment.