Skip to content

Commit

Permalink
Add limits
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Mazzotti <[email protected]>
  • Loading branch information
anmazzotti committed May 30, 2024
1 parent cae5ab9 commit a13acac
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 247 deletions.
169 changes: 0 additions & 169 deletions channels/sle-micro-5-5.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,175 +51,6 @@
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.109"
},
"spec": {
"version": "v2.0.2-4.2.109",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.109",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.111"
},
"spec": {
"version": "v2.0.2-4.2.111",
"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.20"
},
"spec": {
"version": "v2.0.2-4.2.20",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.20",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.70"
},
"spec": {
"version": "v2.0.2-4.2.70",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.70",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.85"
},
"spec": {
"version": "v2.0.2-4.2.85",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.85",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.87"
},
"spec": {
"version": "v2.0.2-4.2.87",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.87",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.89"
},
"spec": {
"version": "v2.0.2-4.2.89",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.89",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.91"
},
"spec": {
"version": "v2.0.2-4.2.91",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.91",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.93"
},
"spec": {
"version": "v2.0.2-4.2.93",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.93",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.94"
},
"spec": {
"version": "v2.0.2-4.2.94",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.94",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.96"
},
"spec": {
"version": "v2.0.2-4.2.96",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.96",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.97"
},
"spec": {
"version": "v2.0.2-4.2.97",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.97",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.2-4.2.99"
},
"spec": {
"version": "v2.0.2-4.2.99",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/5.5:2.0.2-4.2.99",
"displayName": "SLE Micro 5.5 OS"
}
}
},
{
"metadata": {
"name": "v2.0.4"
Expand Down
78 changes: 0 additions & 78 deletions channels/sle-micro-base-5-5.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,84 +51,6 @@
}
}
},
{
"metadata": {
"name": "base-v2.0.2-4.2.65"
},
"spec": {
"version": "v2.0.2-4.2.65",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/base-5.5:2.0.2-4.2.65",
"displayName": "SLE Micro Base 5.5 OS"
}
}
},
{
"metadata": {
"name": "base-v2.0.2-5.5.1"
},
"spec": {
"version": "v2.0.2-5.5.1",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/base-5.5:2.0.2-5.5.1",
"displayName": "SLE Micro Base 5.5 OS"
}
}
},
{
"metadata": {
"name": "base-v2.0.2-5.5.12"
},
"spec": {
"version": "v2.0.2-5.5.12",
"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-5.5.2"
},
"spec": {
"version": "v2.0.2-5.5.2",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/base-5.5:2.0.2-5.5.2",
"displayName": "SLE Micro Base 5.5 OS"
}
}
},
{
"metadata": {
"name": "base-v2.0.2-5.5.6"
},
"spec": {
"version": "v2.0.2-5.5.6",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/base-5.5:2.0.2-5.5.6",
"displayName": "SLE Micro Base 5.5 OS"
}
}
},
{
"metadata": {
"name": "base-v2.0.2-5.5.9"
},
"spec": {
"version": "v2.0.2-5.5.9",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sle-micro/base-5.5:2.0.2-5.5.9",
"displayName": "SLE Micro Base 5.5 OS"
}
}
},
{
"metadata": {
"name": "base-v2.0.4"
Expand Down
4 changes: 4 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ watches:
displayName: "SLE Micro 5.5"
osRepo: registry.suse.com/suse/sle-micro/5.5
isoRepo: registry.suse.com/suse/sle-micro-iso/5.5
limit: 3
- flavor: "base"
fileName: "sle-micro-base-5-5"
displayName: "SLE Micro Base 5.5"
osRepo: registry.suse.com/suse/sle-micro/base-5.5
isoRepo: registry.suse.com/suse/sle-micro-iso/base-5.5
limit: 3
- flavor: "kvm"
fileName: "sle-micro-kvm-5-5"
displayName: "SLE Micro KVM 5.5"
osRepo: registry.suse.com/suse/sle-micro/kvm-5.5
isoRepo: "N/A"
limit: -2
- flavor: "rt"
fileName: "sle-micro-rt-5-5"
displayName: "SLE Micro RT 5.5"
osRepo: registry.suse.com/suse/sle-micro/rt-5.5
isoRepo: "N/A"
limit: -2

15 changes: 15 additions & 0 deletions populate_channels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ while IFS=\= read watch; do
displayName=$(echo "$watch" | yq e '.displayName')
osRepo=$(echo "$watch" | yq e '.osRepo')
isoRepo=$(echo "$watch" | yq e '.isoRepo')
limit=$(echo "$watch" | yq e '.limit')

# Fetch the OS Image tags
osTags=($(skopeo list-tags docker://$osRepo | jq '.Tags[]' | grep -v '.att\|.sig\|latest' | sed 's/"//g'))
Expand All @@ -27,6 +28,13 @@ while IFS=\= read watch; do
else
name="${flavor}-v${tag}"
fi
# Reset counter on non-build tags (ex. v1.2.3)
if [[ $tag =~ ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$ ]]; then
counter=$((limit+1))
elif [[ "$counter" -eq 0 ]]; then
continue
fi
((counter--))
# Fetch image tag
#
# Note that we use the 'org.opencontainers.image.version'
Expand Down Expand Up @@ -60,6 +68,13 @@ EOF
else
name="${flavor}-v${tag}"
fi
# Reset counter on non-build tags (ex. v1.2.3)
if [[ $tag =~ ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$ ]]; then
counter=$((limit+1))
elif [[ "$counter" -eq 0 ]]; then
continue
fi
((counter--))
# Fetch image tag
#
# Note that we use the 'org.opencontainers.image.version'
Expand Down

0 comments on commit a13acac

Please sign in to comment.