Skip to content

Commit 9465385

Browse files
committed
Update flannel
1 parent 3ee99e3 commit 9465385

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

applications/flannel/latest/init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ function init(){
4747
fi
4848
yq e -iN '.podCidr="100.64.0.0/10"' charts/flannel/values.yaml
4949
if [[ "$XY_LATEST" == true ]]; then
50-
yq e -i '.podCidr="172.31.0.0/17"' charts/flannel/values.yaml
50+
cni_tag=$({ curl --silent "https://api.github.com/repos/flannel-io/cni-plugin/releases/latest" | grep tarball_url || echo v1.2.0; } | awk -F\" '{print $(NF-1)}' | awk -F/ '{print $NF}') yq e -i '.podCidr="172.31.0.0/17"|.flannel.image_cni.tag=strenv(cni_tag)' charts/flannel/values.yaml
5151
cat <<EOF | sed -i '/^\s*initContainers/ r /dev/stdin' charts/flannel/templates/daemonset.yaml
5252
- name: install-cni-plugins
53-
image: docker.io/labring4docker/cni-plugins:v1.3.0
53+
image: docker.io/labring4docker/cni-plugins:$({ curl --silent "https://api.github.com/repos/containernetworking/plugins/releases/latest" | grep tarball_url || echo v1.3.0; } | awk -F\" '{print $(NF-1)}' | awk -F/ '{print $NF}')
5454
command: ["/bin/sh"]
5555
args: ["-c", "cp -au /cni-plugins/* /cni-plugin/"]
5656
volumeMounts:

0 commit comments

Comments
 (0)