Automator: update common-files@master in istio/istio.io@master (#14610)

This commit is contained in:
Istio Automation 2024-02-12 16:04:35 -08:00 committed by GitHub
parent a12ad0b9e6
commit 489797c5da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 2 deletions

View File

@ -1 +1 @@
99342562311d5b78d65e06633d5dfe9fc4079935
5f3aa45827fefc83b8cc52149075e461734bcf15

View File

@ -182,14 +182,41 @@ EOF
fi
fi
KIND_WAIT_FLAG="--wait=180s"
KIND_DISABLE_CNI="false"
if [[ -n "${KUBERNETES_CNI:-}" ]]; then
unset KIND_WAIT_FLAG
KIND_DISABLE_CNI="true"
fi
# Create KinD cluster
if ! (kind create cluster --name="${NAME}" --config "${CONFIG}" -v4 --retain --image "${IMAGE}" --wait=180s); then
if ! (yq eval "${CONFIG}" --expression ".networking.disableDefaultCNI = ${KIND_DISABLE_CNI}" | \
kind create cluster --name="${NAME}" -v4 --retain --image "${IMAGE}" ${KIND_WAIT_FLAG:+"$KIND_WAIT_FLAG"} --config -); then
echo "Could not setup KinD environment. Something wrong with KinD setup. Exporting logs."
return 9
fi
# Workaround kind issue causing taints to not be removed in 1.24
kubectl taint nodes "${NAME}"-control-plane node-role.kubernetes.io/control-plane- || true
# Determine what CNI to install
case "${KUBERNETES_CNI:-}" in
"calico")
echo "Installing Calico CNI"
install_calico "" "$(dirname "$CONFIG")"
;;
"")
# perfectly fine, we accepted the default KinD CNI
;;
*)
# we don't know what to do but we've got no CNI, return non-zero
echo "${KUBERNETES_CNI} is not recognized. Supported options are \"calico\" or do not set the variable to use default."
return 1
;;
esac
# If metrics server configuration directory is specified then deploy in
# the cluster just created
if [[ -n ${METRICS_SERVER_CONFIG_DIR:-} ]]; then
@ -362,6 +389,17 @@ function connect_kind_clusters() {
fi
}
function install_calico {
local KUBECONFIG="${1}"
local CONFIG_DIR="${2}"
echo "Setting up ambient cluster, Calico CNI will be used."
kubectl --kubeconfig="$KUBECONFIG" apply -f "${CONFIG_DIR}"/calico.yaml
kubectl --kubeconfig="$KUBECONFIG" wait --for condition=ready -n kube-system pod -l k8s-app=calico-node --timeout 90s
kubectl --kubeconfig="$KUBECONFIG" wait --for condition=ready -n kube-system pod -l k8s-app=calico-kube-controllers --timeout 90s
}
function install_metallb() {
KUBECONFIG="${1}"
kubectl --kubeconfig="$KUBECONFIG" apply -f "${COMMON_SCRIPTS}/metallb-native.yaml"