Skip to content

Provide a clear list of available ClusterStacks (in OCI Registry or GitHub Releases) with versions #224

@matofeder

Description

@matofeder

As a cluster stack user I want to see a clear, discoverable list of available ClusterStack versions, including:

  • ClusterStack.spec.kubernetesVersion
  • ClusterStack.spec.versions (including the relevant sha values)
  • Cluster.topology.version used during cluster creation

At the moment, it's not obvious where this version mapping can be found. Ideally, there would be a table or endpoint showing the full list of published cluster stacks, either:

  • In the OCI registry (if using one)
  • Or via GitHub releases or tags

Example of what I’m looking for:

1.32.1, v0-sha.XXXXX, 1.32
1.32.0, v0-sha.XXXXX, 1.32
1.31.6, v1-sha.YYYYY, 1.31
1.31.5, v1-sha.YYYYY, 1.31
1.31.4, v0-sha.ZZZZZ, 1.31
1.30.11, v2-sha.AAAAA, 1.30
1.30.10, v2-sha.AAAAA, 1.30
1.30.9, v1-sha.BBBBB, 1.30

Find the helper script that does the above for the OCI cluster stacks

#!/bin/bash

REPO="registry.scs.community/kaas/cluster-stacks"
DEST_DIR="./cluster-stacks-tmp"

# Check dependencies
command -v oras >/dev/null 2>&1 || { echo >&2 "oras not found. Install it first."; exit 1; }
command -v yq >/dev/null 2>&1 || { echo >&2 "yq not found. Install it first."; exit 1; }

mkdir -p "$DEST_DIR"

# Array to hold the output rows
declare -a rows
rows+=("infrastructure | ClusterStack.spec.kubernetesVersion | ClusterStack.spec.versions | k8sCluster.topology.version_minor")  # Header row

# Get list of tags (skip header line)
tags=$(oras repo tags "$REPO" | tail -n +2)

for tag in $tags; do
  echo "Pulling: $REPO:$tag"
  target_dir="$DEST_DIR/$tag"
  mkdir -p "$target_dir"

  if ! oras pull "$REPO:$tag" -o "$target_dir"; then
    echo "Failed to pull $tag" >&2
    continue
  fi

  metadata_file="$target_dir/metadata.yaml"
  if [[ -f "$metadata_file" ]]; then
    kubernetes=$(yq e '.versions.kubernetes' "$metadata_file")
    clusterstack=$(yq e '.versions.clusterStack' "$metadata_file")
    k8s_minor=$(echo "$kubernetes" | sed -E 's/v?([0-9]+\.[0-9]+)\..*/\1/')
    infrastructure=$(echo "$tag" | cut -d'-' -f1)

    rows+=("${infrastructure} | ${kubernetes} | ${clusterstack} | ${k8s_minor}")
  else
    echo "No metadata.yaml found in $tag" >&2
  fi
done

# Print all collected output at the end
echo
for row in "${rows[@]}"; do
  echo "$row"
done

rm -rf "$DEST_DIR"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions