Compare commits

...

2 Commits

Author SHA1 Message Date
Alexey Kostarev
50844597b0 Renamed c10f to c10f2. 2024-10-24 17:22:47 +05:00
Alexey Kostarev
f4f1bb8054 Added support for latest tags in <platform>/latest catalog. 2024-10-24 17:21:55 +05:00
30 changed files with 14 additions and 8 deletions

View File

@ -1 +0,0 @@
0/25/1/

1
c10f1
View File

@ -1 +0,0 @@
c10f/

1
c10f2
View File

@ -1 +0,0 @@
c10f/

View File

@ -8,3 +8,6 @@ do
mkdir -p ../$platform/$dir mkdir -p ../$platform/$dir
../fromNativeToRegistry.sh registry.altlinux.org $platform $f > ../$platform/$dir/kube-flannel.yml ../fromNativeToRegistry.sh registry.altlinux.org $platform $f > ../$platform/$dir/kube-flannel.yml
done done
mkdir -p ../$platform/latest
../fromNativeToRegistry.sh registry.altlinux.org $platform $f latest > ../$platform/latest/kube-flannel.yml

View File

@ -2,11 +2,16 @@
function FlannelNameToAlt() { function FlannelNameToAlt() {
image=$1 image=$1
tag=$2
ifs=$IFS ifs=$IFS
IFS=: IFS=:
set -- $image set -- $image
image=$1 image=$1
tag=$2 if [ -z "$tag" ]
then
tag=$2
fi
if [[ $1 =~ "flannel-cni-plugin" ]] if [[ $1 =~ "flannel-cni-plugin" ]]
then then
echo "$U7S_PLATFORM/flannel-cni-plugin:$tag" echo "$U7S_PLATFORM/flannel-cni-plugin:$tag"
@ -18,6 +23,7 @@ function FlannelNameToAlt() {
function kubeflannelYMLToALT() { function kubeflannelYMLToALT() {
registry=$1 registry=$1
kubeFlannelFile=$2 kubeFlannelFile=$2
tag=$3
initCount=$(cat $kubeFlannelFile | initCount=$(cat $kubeFlannelFile |
yq -y 'select(.kind=="DaemonSet").spec.template.spec.initContainers' | yq -y 'select(.kind=="DaemonSet").spec.template.spec.initContainers' |
yq 'length') yq 'length')
@ -27,14 +33,14 @@ function kubeflannelYMLToALT() {
image=$(cat $kubeFlannelFile | image=$(cat $kubeFlannelFile |
yq -y 'select(.kind=="DaemonSet").spec.template.spec.initContainers['$i']' | yq -y 'select(.kind=="DaemonSet").spec.template.spec.initContainers['$i']' |
yq -r '.image') yq -r '.image')
altImage="$registry/$(FlannelNameToAlt $image)" altImage="$registry/$(FlannelNameToAlt $image $tag)"
q+='| select(.kind=="DaemonSet").spec.template.spec.initContainers['$i'].image="'$altImage'"' q+='| select(.kind=="DaemonSet").spec.template.spec.initContainers['$i'].image="'$altImage'"'
let i=$i+1 let i=$i+1
done done
image=$(cat $kubeFlannelFile | image=$(cat $kubeFlannelFile |
yq -y 'select(.kind=="DaemonSet").spec.template.spec.containers[0]' | yq -y 'select(.kind=="DaemonSet").spec.template.spec.containers[0]' |
yq -r '.image') yq -r '.image')
altImage="$registry/$(FlannelNameToAlt $image)" altImage="$registry/$(FlannelNameToAlt $image $tag)"
q+='| select(.kind=="DaemonSet").spec.template.spec.containers[0].image="'$altImage'"' q+='| select(.kind=="DaemonSet").spec.template.spec.containers[0].image="'$altImage'"'
yq -y "$q" $kubeFlannelFile yq -y "$q" $kubeFlannelFile
} }
@ -43,4 +49,5 @@ function kubeflannelYMLToALT() {
registry=$1 registry=$1
export U7S_PLATFORM="k8s-$2" export U7S_PLATFORM="k8s-$2"
file=$3 file=$3
kubeflannelYMLToALT $registry $file tag=$4
kubeflannelYMLToALT $registry $file $tag

View File

@ -1 +0,0 @@
../0/25/1/kube-flannel.yml