From 76a051057971a67b6351e3c2b3d19f615ab519e6 Mon Sep 17 00:00:00 2001 From: Alexey Kostarev Date: Thu, 24 Oct 2024 23:53:20 +0500 Subject: [PATCH] Modified fromNativeToPlatform.sh - form kube-flannel.yml only for supported images --- fromNativeToPlatform.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/fromNativeToPlatform.sh b/fromNativeToPlatform.sh index 4b90b63..3ee01c0 100755 --- a/fromNativeToPlatform.sh +++ b/fromNativeToPlatform.sh @@ -1,10 +1,33 @@ +function getFlannelDirs() { + platform=$1 + export U7S_PLATFORM="k8s-$platform" + tags=$(curl https://registry.altlinux.org/v2/$U7S_PLATFORM/flannel/tags/list | jq -r '.tags|sort|.[]' | grep -e '^v.*') 2>/dev/null + ifs=$IFS + dirs='' + for tag in $tags + do + IFS=. + set -- $tag + major=${1:1:1} + minor=$2 + patch=$3 + dir="$major/$minor/$patch" + dirs+=" $dir" + done + echo $dirs +} + + + platform=$(basename $1) +dirs=$(getFlannelDirs $platform) + cd native -for f in */*/*/kube-flannel.yml +for dir in $dirs do - dir=$(dirname $f) echo $dir + f="$dir/kube-flannel.yml" mkdir -p ../$platform/$dir ../fromNativeToRegistry.sh registry.altlinux.org $platform $f > ../$platform/$dir/kube-flannel.yml done