<commit_before>#!/bin/bash
set -e

TARGET_COMPONENTS="containerd calico cilium flannel kube-ovn kube-router weave cert-manager krew helm metallb registry cephfs-provisioner rbd-provisioner aws-ebs-csi-plugin azure-csi-plugin cinder-csi-plugin gcp-pd-csi-plugin local-path-provisioner local-volume-provisioner"

# cd to the root directory of kubespray
cd $(dirname $0)/../../

echo checking kubernetes..
version_from_default=$(grep "^kube_version:" ./roles/kubespray-defaults/defaults/main.yaml | awk '{print $2}' | sed s/\"//g)
version_from_readme=$(grep " \[kubernetes\]" ./README.md | awk '{print $3}')
if [ "${version_from_default}" != "${version_from_readme}" ]; then
	echo "The version of kubernetes is different between main.yml(${version_from_default}) and README.md(${version_from_readme})."
	echo "If the pull request updates kubernetes version, please update README.md also."
	exit 1
fi

for component in $(echo ${TARGET_COMPONENTS}); do
	echo checking ${component}..
	version_from_default=$(grep "^$(echo ${component} | sed s/"-"/"_"/g)_version:" ./roles/download/defaults/main.yml | awk '{print $2}' | sed s/\"//g | sed s/^v//)
	version_from_readme=$(grep "\[${component}\]" ./README.md | grep "https" | awk '{print $3}' | sed s/^v//)
	if [ "${version_from_default}" != "${version_from_readme}" ]; then
		echo "The version of ${component} is different between main.yml(${version_from_default}) and README.md(${version_from_readme})."
		echo "If the pull request updates ${component} version, please update README.md also."
		exit 1
	fi
done

echo "Succeeded to check all components."
exit 0
<commit_msg>Add kube-vip check to check_readme_versions.sh (#9155)<commit_after>#!/bin/bash
set -e

TARGET_COMPONENTS="containerd calico cilium flannel kube-ovn kube-router weave cert-manager krew helm metallb registry cephfs-provisioner rbd-provisioner aws-ebs-csi-plugin azure-csi-plugin cinder-csi-plugin gcp-pd-csi-plugin local-path-provisioner local-volume-provisioner kube-vip"

# cd to the root directory of kubespray
cd $(dirname $0)/../../

echo checking kubernetes..
version_from_default=$(grep "^kube_version:" ./roles/kubespray-defaults/defaults/main.yaml | awk '{print $2}' | sed s/\"//g)
version_from_readme=$(grep " \[kubernetes\]" ./README.md | awk '{print $3}')
if [ "${version_from_default}" != "${version_from_readme}" ]; then
	echo "The version of kubernetes is different between main.yml(${version_from_default}) and README.md(${version_from_readme})."
	echo "If the pull request updates kubernetes version, please update README.md also."
	exit 1
fi

for component in $(echo ${TARGET_COMPONENTS}); do
	echo checking ${component}..
	version_from_default=$(grep "^$(echo ${component} | sed s/"-"/"_"/g)_version:" ./roles/download/defaults/main.yml | awk '{print $2}' | sed s/\"//g | sed s/^v//)
	if [ "${version_from_default}" = "" ]; then
		version_from_default=$(grep "^$(echo ${component} | sed s/"-"/"_"/g)_version:" ./roles/kubernetes/node/defaults/main.yml | awk '{print $2}' | sed s/\"//g | sed s/^v//)
	fi
	version_from_readme=$(grep "\[${component}\]" ./README.md | grep "https" | awk '{print $3}' | sed s/^v//)
	if [ "${version_from_default}" != "${version_from_readme}" ]; then
		echo "The version of ${component} is different between main.yml(${version_from_default}) and README.md(${version_from_readme})."
		echo "If the pull request updates ${component} version, please update README.md also."
		exit 1
	fi
done

echo "Succeeded to check all components."
exit 0

{'fraction_non_alphanumeric': 0.16519005430122893, 'fraction_numerical': 0.006001714775650186, 'mean_word_length': 4.804311774461028, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5202212', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1180, 'n_words': 325}