mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
Merge pull request #11905 from VannTen/feat/readme_template_version
Update README.md versions automatically in pre-commit
This commit is contained in:
@@ -10,7 +10,6 @@ variables:
|
||||
FAILFASTCI_NAMESPACE: 'kargo-ci'
|
||||
GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray'
|
||||
ANSIBLE_FORCE_COLOR: "true"
|
||||
ANSIBLE_STDOUT_CALLBACK: "debug"
|
||||
MAGIC: "ci check this"
|
||||
GS_ACCESS_KEY_ID: $GS_KEY
|
||||
GS_SECRET_ACCESS_KEY: $GS_SECRET
|
||||
@@ -43,6 +42,8 @@ before_script:
|
||||
- cluster-dump/
|
||||
needs:
|
||||
- pipeline-image
|
||||
variables:
|
||||
ANSIBLE_STDOUT_CALLBACK: "debug"
|
||||
|
||||
.job-moderated:
|
||||
extends: .job
|
||||
|
||||
@@ -20,12 +20,6 @@ repos:
|
||||
- id: yamllint
|
||||
args: [--strict]
|
||||
|
||||
- repo: https://github.com/markdownlint/markdownlint
|
||||
rev: v0.12.0
|
||||
hooks:
|
||||
- id: markdownlint
|
||||
exclude: "^.github|(^docs/_sidebar\\.md$)"
|
||||
|
||||
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||
rev: v0.10.0.1
|
||||
hooks:
|
||||
@@ -51,12 +45,6 @@ repos:
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: check-readme-versions
|
||||
name: check-readme-versions
|
||||
entry: tests/scripts/check_readme_versions.sh
|
||||
language: script
|
||||
pass_filenames: false
|
||||
|
||||
- id: collection-build-install
|
||||
name: Build and install kubernetes-sigs.kubespray Ansible collection
|
||||
language: python
|
||||
@@ -90,3 +78,17 @@ repos:
|
||||
- jinja
|
||||
additional_dependencies:
|
||||
- jinja2
|
||||
|
||||
- id: render-readme-versions
|
||||
name: Update versions in README.md to match their defaults values
|
||||
language: python
|
||||
additional_dependencies:
|
||||
- ansible-core>=2.16.4
|
||||
entry: scripts/render_readme_version.yml
|
||||
pass_filenames: false
|
||||
|
||||
- repo: https://github.com/markdownlint/markdownlint
|
||||
rev: v0.12.0
|
||||
hooks:
|
||||
- id: markdownlint
|
||||
exclude: "^.github|(^docs/_sidebar\\.md$)"
|
||||
|
||||
10
README.md
10
README.md
@@ -96,20 +96,22 @@ Note:
|
||||
|
||||
## Supported Components
|
||||
|
||||
[//]: # BEGIN ANSIBLE MANAGED BLOCK
|
||||
|
||||
- Core
|
||||
- [kubernetes](https://github.com/kubernetes/kubernetes) v1.32.0
|
||||
- [etcd](https://github.com/etcd-io/etcd) v3.5.16
|
||||
- [docker](https://www.docker.com/) v26.1
|
||||
- [containerd](https://containerd.io/) v1.7.24
|
||||
- [cri-o](http://cri-o.io/) v1.31.0 (experimental: see [CRI-O Note](docs/CRI/cri-o.md). Only on fedora, ubuntu and centos based OS)
|
||||
- [cri-o](http://cri-o.io/) v1.32.0 (experimental: see [CRI-O Note](docs/CRI/cri-o.md). Only on fedora, ubuntu and centos based OS)
|
||||
- Network Plugin
|
||||
- [cni-plugins](https://github.com/containernetworking/plugins) v1.2.0
|
||||
- [cni-plugins](https://github.com/containernetworking/plugins) v1.4.0
|
||||
- [calico](https://github.com/projectcalico/calico) v3.29.1
|
||||
- [cilium](https://github.com/cilium/cilium) v1.15.9
|
||||
- [flannel](https://github.com/flannel-io/flannel) v0.22.0
|
||||
- [kube-ovn](https://github.com/alauda/kube-ovn) v1.12.21
|
||||
- [kube-router](https://github.com/cloudnativelabs/kube-router) v2.0.0
|
||||
- [multus](https://github.com/k8snetworkplumbingwg/multus-cni) v3.8
|
||||
- [multus](https://github.com/k8snetworkplumbingwg/multus-cni) v4.1.0
|
||||
- [weave](https://github.com/rajch/weave) v2.8.7
|
||||
- [kube-vip](https://github.com/kube-vip/kube-vip) v0.8.0
|
||||
- Application
|
||||
@@ -132,6 +134,8 @@ Note:
|
||||
- [local-volume-provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner) v2.5.0
|
||||
- [node-feature-discovery](https://github.com/kubernetes-sigs/node-feature-discovery) v0.16.4
|
||||
|
||||
[//]: # END ANSIBLE MANAGED BLOCK
|
||||
|
||||
## Container Runtime Notes
|
||||
|
||||
- The cri-o version should be aligned with the respective kubernetes version (i.e. kube_version=1.20.x, crio_version=1.20)
|
||||
|
||||
35
scripts/readme_versions.md.j2
Normal file
35
scripts/readme_versions.md.j2
Normal file
@@ -0,0 +1,35 @@
|
||||
- Core
|
||||
- [kubernetes](https://github.com/kubernetes/kubernetes) {{ kube_version }}
|
||||
- [etcd](https://github.com/etcd-io/etcd) {{ etcd_version }}
|
||||
- [docker](https://www.docker.com/) v{{ docker_version }}
|
||||
- [containerd](https://containerd.io/) v{{ containerd_version }}
|
||||
- [cri-o](http://cri-o.io/) {{ crio_version }} (experimental: see [CRI-O Note](docs/CRI/cri-o.md). Only on fedora, ubuntu and centos based OS)
|
||||
- Network Plugin
|
||||
- [cni-plugins](https://github.com/containernetworking/plugins) {{ cni_version }}
|
||||
- [calico](https://github.com/projectcalico/calico) {{ calico_version }}
|
||||
- [cilium](https://github.com/cilium/cilium) {{ cilium_version }}
|
||||
- [flannel](https://github.com/flannel-io/flannel) {{ flannel_version }}
|
||||
- [kube-ovn](https://github.com/alauda/kube-ovn) {{ kube_ovn_version }}
|
||||
- [kube-router](https://github.com/cloudnativelabs/kube-router) {{ kube_router_version }}
|
||||
- [multus](https://github.com/k8snetworkplumbingwg/multus-cni) {{ multus_version }}
|
||||
- [weave](https://github.com/rajch/weave) v{{ weave_version }}
|
||||
- [kube-vip](https://github.com/kube-vip/kube-vip) {{ kube_vip_version }}
|
||||
- Application
|
||||
- [cert-manager](https://github.com/jetstack/cert-manager) {{ cert_manager_version }}
|
||||
- [coredns](https://github.com/coredns/coredns) {{ coredns_version }}
|
||||
- [ingress-nginx](https://github.com/kubernetes/ingress-nginx) {{ ingress_nginx_version }}
|
||||
- [krew](https://github.com/kubernetes-sigs/krew) {{ krew_version }}
|
||||
- [argocd](https://argoproj.github.io/) {{ argocd_version }}
|
||||
- [helm](https://helm.sh/) {{ helm_version }}
|
||||
- [metallb](https://metallb.universe.tf/) {{ metallb_version }}
|
||||
- [registry](https://github.com/distribution/distribution) v{{ registry_version }}
|
||||
- Storage Plugin
|
||||
- [cephfs-provisioner](https://github.com/kubernetes-incubator/external-storage) {{ cephfs_provisioner_version }}
|
||||
- [rbd-provisioner](https://github.com/kubernetes-incubator/external-storage) {{ rbd_provisioner_version }}
|
||||
- [aws-ebs-csi-plugin](https://github.com/kubernetes-sigs/aws-ebs-csi-driver) {{ aws_ebs_csi_plugin_version }}
|
||||
- [azure-csi-plugin](https://github.com/kubernetes-sigs/azuredisk-csi-driver) {{ azure_csi_plugin_version }}
|
||||
- [cinder-csi-plugin](https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/cinder-csi-plugin/using-cinder-csi-plugin.md) {{ cinder_csi_plugin_version }}
|
||||
- [gcp-pd-csi-plugin](https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver) {{ gcp_pd_csi_plugin_version }}
|
||||
- [local-path-provisioner](https://github.com/rancher/local-path-provisioner) {{ local_path_provisioner_version }}
|
||||
- [local-volume-provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner) {{ local_volume_provisioner_version }}
|
||||
- [node-feature-discovery](https://github.com/kubernetes-sigs/node-feature-discovery) {{ node_feature_discovery_version }}
|
||||
22
scripts/render_readme_version.yml
Executable file
22
scripts/render_readme_version.yml
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env ansible-playbook
|
||||
---
|
||||
- name: Update README.md versions
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: false
|
||||
vars:
|
||||
fallback_ip: 'bypass tasks in kubespray-defaults'
|
||||
roles:
|
||||
- kubespray-defaults
|
||||
tasks:
|
||||
- name: Include versions not in kubespray-defaults
|
||||
include_vars: "{{ item }}"
|
||||
loop:
|
||||
- ../roles/container-engine/docker/defaults/main.yml
|
||||
- ../roles/kubernetes/node/defaults/main.yml
|
||||
- ../roles/kubernetes-apps/argocd/defaults/main.yml
|
||||
- name: Render versions in README.md
|
||||
blockinfile:
|
||||
marker: '[//]: # {mark} ANSIBLE MANAGED BLOCK'
|
||||
block: "\n{{ lookup('ansible.builtin.template', 'readme_versions.md.j2') }}\n\n"
|
||||
path: ../README.md
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/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 ingress-nginx node-feature-discovery"
|
||||
|
||||
# cd to the root directory of kubespray
|
||||
cd $(dirname $0)/../../
|
||||
|
||||
echo checking kubernetes..
|
||||
version_from_default=$(grep "^kube_version:" ./roles/kubespray-defaults/defaults/main/main.yml | 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/kubespray-defaults/defaults/main/download.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
|
||||
Reference in New Issue
Block a user