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