Skip to content

Commit

Permalink
Propagate creation date to ManagedOSVersion (#64)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Mazzotti <[email protected]>
  • Loading branch information
anmazzotti authored Nov 27, 2024
1 parent f8e7e59 commit 9b986a1
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 26 deletions.
16 changes: 9 additions & 7 deletions channels/sl-micro-61-baremetal.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[
{
"metadata": {
"name": "baremetal-v2.2.0-3.7-os"
"name": "baremetal-v2.2.0-3.9-os"
},
"spec": {
"version": "v2.2.0-3.7",
"version": "v2.2.0-3.9",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/baremetal-os-container:2.2.0-3.7",
"displayName": "SL Micro 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"]
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/baremetal-os-container:2.2.0-3.9",
"displayName": "SL Micro Baremetal 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1732636343
}
}
},
Expand All @@ -22,8 +23,9 @@
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/baremetal-iso-image:2.2.0-3.7",
"displayName": "SL Micro 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"]
"displayName": "SL Micro Baremetal 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1730920423
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions channels/sl-micro-61-base.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[
{
"metadata": {
"name": "base-v2.2.0-3.5-os"
"name": "base-v2.2.0-3.9-os"
},
"spec": {
"version": "v2.2.0-3.5",
"version": "v2.2.0-3.9",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/base-os-container:2.2.0-3.5",
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/base-os-container:2.2.0-3.9",
"displayName": "SL Micro Base 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"]
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1732636077
}
}
},
Expand All @@ -23,7 +24,8 @@
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/base-iso-image:2.2.0-3.7",
"displayName": "SL Micro Base 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"]
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1730920380
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions channels/sl-micro-61-kvm.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[
{
"metadata": {
"name": "kvm-v2.2.0-3.10-os"
"name": "kvm-v2.2.0-3.12-os"
},
"spec": {
"version": "v2.2.0-3.10",
"version": "v2.2.0-3.12",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/kvm-os-container:2.2.0-3.10",
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/kvm-os-container:2.2.0-3.12",
"displayName": "SL Micro KVM 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"]
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1732636264
}
}
},
Expand All @@ -23,7 +24,8 @@
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/kvm-iso-image:2.2.0-3.9",
"displayName": "SL Micro KVM 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"]
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1730920378
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions channels/sl-micro-61-rt.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[
{
"metadata": {
"name": "rt-v2.2.0-3.7-os"
"name": "rt-v2.2.0-3.9-os"
},
"spec": {
"version": "v2.2.0-3.7",
"version": "v2.2.0-3.9",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/rt-os-container:2.2.0-3.7",
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/rt-os-container:2.2.0-3.9",
"displayName": "SL Micro RT 6.1 OS",
"platforms": ["linux/x86_64"]
"platforms": ["linux/x86_64"],
"created": 1732636695
}
}
},
Expand All @@ -23,7 +24,8 @@
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/rt-iso-image:2.2.0-3.7",
"displayName": "SL Micro RT 6.1 ISO",
"platforms": ["linux/x86_64"]
"platforms": ["linux/x86_64"],
"created": 1730920760
}
}
}
Expand Down
15 changes: 11 additions & 4 deletions refresh_channels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function append_os_entry() {
local image_uri=$4
local display_name=$5
local platforms=$6
local creation_date_epoch=$7
cat >> "$file" << EOF
{
"metadata": {
Expand All @@ -68,7 +69,8 @@ function append_os_entry() {
"metadata": {
"upgradeImage": "$image_uri",
"displayName": "$display_name OS",
"platforms": $platforms
"platforms": $platforms,
"created": $creation_date_epoch
}
}
},
Expand All @@ -83,6 +85,7 @@ function append_iso_entry() {
local image_uri=$4
local display_name=$5
local platforms=$6
local creation_date_epoch=$7
cat >> "$file" << EOF
{
"metadata": {
Expand All @@ -94,7 +97,8 @@ function append_iso_entry() {
"metadata": {
"uri": "$image_uri",
"displayName": "$display_name ISO",
"platforms": $platforms
"platforms": $platforms,
"created": $creation_date_epoch
}
}
},
Expand All @@ -115,11 +119,14 @@ function process_intermediate_list() {
local managed_os_version_name=$(echo "$entry" | jq -r '.managedOSVersionName')
local display_name=$(echo "$entry" | jq -r '.displayName')
local platforms=$(echo "$entry" | jq -c '[.platforms[]]')
local creation_date=$(echo "$entry" | jq -r '.created')

local creation_date_epoch=$(date -d "$creation_date" +"%s")

if [[ "$type" == "os" ]]; then
append_os_entry "$file" "$managed_os_version_name" "$version" "$image_uri" "$display_name" "$platforms"
append_os_entry "$file" "$managed_os_version_name" "$version" "$image_uri" "$display_name" "$platforms" "$creation_date_epoch"
elif [[ "$type" == "iso" ]]; then
append_iso_entry "$file" "$managed_os_version_name" "$version" "$image_uri" "$display_name" "$platforms"
append_iso_entry "$file" "$managed_os_version_name" "$version" "$image_uri" "$display_name" "$platforms" "$creation_date_epoch"
fi
done
}
Expand Down

0 comments on commit 9b986a1

Please sign in to comment.