├── .cirrus.yml ├── .github ├── renovate.json └── workflows │ └── sync-with-upstream.yml ├── .gitmodules ├── .images.yml ├── .yamllint.yml ├── .zuul.yaml ├── README.md ├── extra_vars_130.json ├── extra_vars_131.json ├── extra_vars_132.json ├── extra_vars_133.json ├── playbooks ├── build.yml ├── post.yml └── pre.yml ├── scripts └── run-update-extra-vars.sh └── src └── update-extra-vars.py /.cirrus.yml: -------------------------------------------------------------------------------- 1 | --- 2 | compute_engine_instance: 3 | image_project: cirrus-images 4 | image: family/docker-kvm 5 | platform: linux 6 | cpu: 4 7 | memory: 16G 8 | disk: 100 9 | nested_virtualization: true 10 | 11 | # environment variables 12 | 13 | env: 14 | DEBIAN_FRONTEND: noninteractive 15 | HOME: "$CIRRUS_WORKING_DIR" 16 | PACKER_TMP_DIR: "$CIRRUS_WORKING_DIR/.packer.d" 17 | MINIO_ACCESS_KEY: "ENCRYPTED[f1e5f3b5e72297422e2ec817e8833a2e8d69fe75e3db78a7e4ba20581578752d6f6f61d1ed1d1254b6b54b7ae8bc6af9]" 18 | MINIO_SECRET_KEY: "ENCRYPTED[adba7892ef6bb89524abc57e38b401e77a268d129c44cd792a9dd064b8dcb0cf050dd4e906059d0f94ae4ac92d8e869b]" 19 | 20 | build_task_template: &BUILD_TASK_TEMPLATE 21 | timeout_in: 120m 22 | install_script: | 23 | while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do sleep 5; done; 24 | while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do sleep 5; done; 25 | apt-get update 26 | while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do sleep 5; done; 27 | while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do sleep 5; done; 28 | apt-get install -y git make python3-pip curl jq unzip 29 | 30 | prepare_script: | 31 | git clone https://github.com/kubernetes-sigs/image-builder 32 | cd image-builder/images/capi 33 | export PATH=$PWD/.bin:$HOME/.local/bin:$PATH 34 | make deps-qemu 35 | 36 | build_script: | 37 | cd image-builder/images/capi 38 | export PATH=$PWD/.bin:$HOME/.local/bin:$PATH 39 | make build-qemu-ubuntu-2204 40 | 41 | prepare_push_script: | 42 | pushd image-builder/images/capi/output/ubuntu-2204-kube-v$IMAGE_IDENTIFIER 43 | find . -type f -execdir bash -c 'x={}; cp $x ${x%.*}.qcow2; mv $x $x.qcow2' \; 44 | find . -name '*.qcow2' -execdir bash -c 'x={}; sha256sum $(basename $x) > $x.CHECKSUM' \; 45 | find . -name "*$IMAGE_IDENTIFIER.*.qcow2" -execdir bash -c 'x={}; echo $(date +%Y-%m-%d) ubuntu-2204-kube-v$IMAGE_IDENTIFIER/$(basename $x) > last-$IMAGE_IDENTIFIER' \; 46 | ls -lah 47 | popd 48 | mv image-builder/images/capi/output/ubuntu-2204-kube-v$IMAGE_IDENTIFIER/last-$IMAGE_IDENTIFIER . 49 | cat last-$IMAGE_IDENTIFIER 50 | 51 | push_script: | 52 | if [[ "$CIRRUS_BRANCH" == "main" ]]; then 53 | wget https://dl.min.io/client/mc/release/linux-amd64/mc 54 | chmod +x mc 55 | ./mc alias set minio https://swift.services.a.regiocloud.tech $MINIO_ACCESS_KEY $MINIO_SECRET_KEY 56 | ./mc cp last-$IMAGE_IDENTIFIER minio/openstack-k8s-capi-images 57 | ./mc cp --recursive image-builder/images/capi/output/* minio/openstack-k8s-capi-images 58 | ./mc policy set download minio/openstack-k8s-capi-images 59 | fi 60 | 61 | build_130_task: 62 | <<: *BUILD_TASK_TEMPLATE 63 | skip: "!changesInclude('extra_vars_130.json', '.cirrus.yml')" 64 | env: 65 | IMAGE_IDENTIFIER: "1.30" 66 | PACKER_VAR_FILES: ../../../extra_vars_130.json 67 | 68 | build_131_task: 69 | <<: *BUILD_TASK_TEMPLATE 70 | skip: "!changesInclude('extra_vars_131.json', '.cirrus.yml')" 71 | env: 72 | IMAGE_IDENTIFIER: "1.31" 73 | PACKER_VAR_FILES: ../../../extra_vars_131.json 74 | 75 | build_132_task: 76 | <<: *BUILD_TASK_TEMPLATE 77 | skip: "!changesInclude('extra_vars_132.json', '.cirrus.yml')" 78 | env: 79 | IMAGE_IDENTIFIER: "1.32" 80 | PACKER_VAR_FILES: ../../../extra_vars_132.json 81 | 82 | build_133_task: 83 | <<: *BUILD_TASK_TEMPLATE 84 | skip: "!changesInclude('extra_vars_133.json', '.cirrus.yml')" 85 | env: 86 | IMAGE_IDENTIFIER: "1.33" 87 | PACKER_VAR_FILES: ../../../extra_vars_133.json 88 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "github>osism/renovate-config" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.github/workflows/sync-with-upstream.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Sync with upstream 3 | 4 | "on": 5 | workflow_dispatch: 6 | schedule: 7 | - cron: "0 0 * * *" 8 | push: 9 | branches: 10 | - main 11 | 12 | jobs: 13 | sync-with-upstream: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout repo 17 | uses: actions/checkout@v2 18 | with: 19 | submodules: true 20 | 21 | - name: Setup python 3.9 22 | uses: actions/setup-python@v2 23 | with: 24 | python-version: '3.9' 25 | 26 | - name: Install ruaeml.yaml 27 | run: pip3 install ruamel.yaml 28 | 29 | - uses: technote-space/create-pr-action@v2 30 | with: 31 | EXECUTE_COMMANDS: | 32 | ./scripts/run-update-extra-vars.sh 33 | COMMIT_EMAIL: 'bot@osism.tech' 34 | COMMIT_MESSAGE: | 35 | chore: sync with upstream 36 | 37 | Signed-off-by: OSISM Bot 38 | COMMIT_NAME: 'OSISM Bot' 39 | ONLY_DEFAULT_BRANCH: true 40 | PR_BRANCH_NAME: 'sync-with-upstream' 41 | PR_BRANCH_PREFIX: 'chore/' 42 | PR_TITLE: 'chore: sync with upstream' 43 | AUTO_MERGE_THRESHOLD_DAYS: 1 44 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osism/k8s-capi-images/0cd478cd1171e4e81b7e5033e04d802e6260c419/.gitmodules -------------------------------------------------------------------------------- /.images.yml: -------------------------------------------------------------------------------- 1 | --- 2 | images: 3 | - name: Kubernetes CAPI 4 | enable: true 5 | keep: true 6 | format: qcow2 7 | login: ubuntu 8 | min_disk: 20 9 | min_ram: 512 10 | status: active 11 | visibility: public 12 | multi: false 13 | meta: 14 | architecture: x86_64 15 | hw_disk_bus: virtio 16 | hw_rng_model: virtio 17 | hw_scsi_model: virtio-scsi 18 | hw_watchdog_action: reset 19 | os_distro: ubuntu 20 | replace_frequency: never 21 | uuid_validity: none 22 | provided_until: none 23 | tags: [] 24 | versions: 25 | - version: '1.26.8' 26 | url: https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.26/ubuntu-2204-kube-v1.26.8.qcow2 27 | checksum: "sha256:227dbb3b2ac5c53f2bed33f3d31e0788724023d5b49d72a0fa8da727f758f09e" 28 | build_date: '2023-08-28' 29 | - version: '1.27.5' 30 | url: https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.27/ubuntu-2204-kube-v1.27.5.qcow2 31 | checksum: "sha256:ab2d843dc64fd4c20afdd0ec567c70ab8570b0e7cde7c1dd08c0ace8d7152d37" 32 | build_date: '2023-08-28' 33 | - version: '1.28.0' 34 | url: https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.28/ubuntu-2204-kube-v1.28.0.qcow2 35 | checksum: "sha256:95ee88fd3eda47686176049b7a0597f3ab06d16f9633706dcd2ec93e259adf66" 36 | build_date: '2023-08-29' 37 | -------------------------------------------------------------------------------- /.yamllint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | 4 | rules: 5 | line-length: 6 | max: 200 7 | comments: enable 8 | 9 | ignore: | 10 | image-builder/ 11 | -------------------------------------------------------------------------------- /.zuul.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - job: 3 | name: k8s-capi-images-build 4 | parent: base 5 | pre-run: playbooks/pre.yml 6 | run: playbooks/build.yml 7 | required-projects: 8 | - kubernetes-sigs/image-builder 9 | 10 | - project: 11 | merge-mode: squash-merge 12 | default-branch: main 13 | check: 14 | jobs: 15 | - flake8 16 | - yamllint 17 | periodic-daily: 18 | jobs: 19 | - flake8 20 | - yamllint 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kubernetes-capi-images 2 | 3 | Images intended for use with Kubernetes CAPI providers. More details on 4 | https://image-builder.sigs.k8s.io/capi/capi.html. 5 | 6 | The images are built with the [Image Builder](https://github.com/kubernetes-sigs/image-builder/), 7 | a collection of cross-provider Kubernetes virtual machine image building 8 | utilities. 9 | 10 | When a Kubernetes series changes to EOL status, the corresponding builds 11 | are deactivated here and only the last version of this series will remain 12 | available as an image in the future. 13 | 14 | The following images contain the latest [stable releases](https://kubernetes.io/releases/), 15 | which are updated as required. This means that the image for version `1.27` 16 | contains, for example, version `1.27.3`. 17 | 18 | | Version | Image URL | End of life | 19 | |---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------| 20 | | v1.33 | [ubuntu-2204-kube-v1.33.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.33/ubuntu-2204-kube-v1.33.qcow2) | [2026-06-28](https://endoflife.date/kubernetes) | 21 | | v1.32 | [ubuntu-2204-kube-v1.32.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.qcow2) | [2026-02-28](https://endoflife.date/kubernetes) | 22 | | v1.31 | [ubuntu-2204-kube-v1.31.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.qcow2) | [2025-10-28](https://endoflife.date/kubernetes) | 23 | | v1.30 | [ubuntu-2204-kube-v1.30.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.qcow2) | [2025-04-28](https://endoflife.date/kubernetes) | 24 | 25 | ## Ubuntu 22.04 26 | 27 | | Series | Version | Image URL | CHECKSUM URL | 28 | |--------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 29 | | v1.33 | | | | 30 | | | v1.33.1 | [ubuntu-2204-kube-v1.33.1.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.33/ubuntu-2204-kube-v1.33.1.qcow2) | [ubuntu-2204-kube-v1.33.1.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.33/ubuntu-2204-kube-v1.33.1.qcow2.CHECKSUM) | 31 | | | v1.33.0 | [ubuntu-2204-kube-v1.33.0.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.33/ubuntu-2204-kube-v1.33.0.qcow2) | [ubuntu-2204-kube-v1.33.0.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.33/ubuntu-2204-kube-v1.33.0.qcow2.CHECKSUM) | 32 | | v1.32 | | | | 33 | | | v1.32.5 | [ubuntu-2204-kube-v1.32.5.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.5.qcow2) | [ubuntu-2204-kube-v1.32.5.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.5.qcow2.CHECKSUM) | 34 | | | v1.32.4 | [ubuntu-2204-kube-v1.32.4.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.4.qcow2) | [ubuntu-2204-kube-v1.32.4.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.4.qcow2.CHECKSUM) | 35 | | | v1.32.3 | [ubuntu-2204-kube-v1.32.3.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.3.qcow2) | [ubuntu-2204-kube-v1.32.3.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.3.qcow2.CHECKSUM) | 36 | | | v1.32.2 | [ubuntu-2204-kube-v1.32.2.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.2.qcow2) | [ubuntu-2204-kube-v1.32.2.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.2.qcow2.CHECKSUM) | 37 | | | v1.32.1 | [ubuntu-2204-kube-v1.32.1.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.1.qcow2) | [ubuntu-2204-kube-v1.32.1.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.1.qcow2.CHECKSUM) | 38 | | | v1.32.0 | [ubuntu-2204-kube-v1.32.0.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.0.qcow2) | [ubuntu-2204-kube-v1.32.0.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.32/ubuntu-2204-kube-v1.32.0.qcow2.CHECKSUM) | 39 | | v1.31 | | | | 40 | | | v1.31.9 | [ubuntu-2204-kube-v1.31.9.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.9.qcow2) | [ubuntu-2204-kube-v1.31.9.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.9.qcow2.CHECKSUM) | 41 | | | v1.31.8 | [ubuntu-2204-kube-v1.31.8.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.8.qcow2) | [ubuntu-2204-kube-v1.31.8.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.8.qcow2.CHECKSUM) | 42 | | | v1.31.7 | [ubuntu-2204-kube-v1.31.7.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.7.qcow2) | [ubuntu-2204-kube-v1.31.7.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.7.qcow2.CHECKSUM) | 43 | | | v1.31.6 | [ubuntu-2204-kube-v1.31.6.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.6.qcow2) | [ubuntu-2204-kube-v1.31.6.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.6.qcow2.CHECKSUM) | 44 | | | v1.31.5 | [ubuntu-2204-kube-v1.31.5.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.5.qcow2) | [ubuntu-2204-kube-v1.31.5.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.5.qcow2.CHECKSUM) | 45 | | | v1.31.4 | [ubuntu-2204-kube-v1.31.4.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.4.qcow2) | [ubuntu-2204-kube-v1.31.4.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.4.qcow2.CHECKSUM) | 46 | | | v1.31.3 | [ubuntu-2204-kube-v1.31.3.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.3.qcow2) | [ubuntu-2204-kube-v1.31.3.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.3.qcow2.CHECKSUM) | 47 | | | v1.31.2 | [ubuntu-2204-kube-v1.31.2.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.2.qcow2) | [ubuntu-2204-kube-v1.31.2.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.2.qcow2.CHECKSUM) | 48 | | | v1.31.1 | [ubuntu-2204-kube-v1.31.1.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.1.qcow2) | [ubuntu-2204-kube-v1.31.1.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.1.qcow2.CHECKSUM) | 49 | | | v1.31.0 | [ubuntu-2204-kube-v1.31.0.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.0.qcow2) | [ubuntu-2204-kube-v1.31.0.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.31/ubuntu-2204-kube-v1.31.0.qcow2.CHECKSUM) | 50 | | v1.30 | | | | 51 | | | v1.30.13 | [ubuntu-2204-kube-v1.30.13.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.13.qcow2) | [ubuntu-2204-kube-v1.30.13.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.13.qcow2.CHECKSUM) | 52 | | | v1.30.12 | [ubuntu-2204-kube-v1.30.12.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.12.qcow2) | [ubuntu-2204-kube-v1.30.12.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.12.qcow2.CHECKSUM) | 53 | | | v1.30.11 | [ubuntu-2204-kube-v1.30.11.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.11.qcow2) | [ubuntu-2204-kube-v1.30.11.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.11.qcow2.CHECKSUM) | 54 | | | v1.30.10 | [ubuntu-2204-kube-v1.30.10.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.10.qcow2) | [ubuntu-2204-kube-v1.30.10.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.10.qcow2.CHECKSUM) | 55 | | | v1.30.9 | [ubuntu-2204-kube-v1.30.9.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.9.qcow2) | [ubuntu-2204-kube-v1.30.9.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.9.qcow2.CHECKSUM) | 56 | | | v1.30.8 | [ubuntu-2204-kube-v1.30.8.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.8.qcow2) | [ubuntu-2204-kube-v1.30.8.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.8.qcow2.CHECKSUM) | 57 | | | v1.30.7 | [ubuntu-2204-kube-v1.30.7.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.7.qcow2) | [ubuntu-2204-kube-v1.30.7.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.7.qcow2.CHECKSUM) | 58 | | | v1.30.6 | [ubuntu-2204-kube-v1.30.6.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.6.qcow2) | [ubuntu-2204-kube-v1.30.6.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.6.qcow2.CHECKSUM) | 59 | | | v1.30.5 | [ubuntu-2204-kube-v1.30.5.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.5.qcow2) | [ubuntu-2204-kube-v1.30.5.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.5.qcow2.CHECKSUM) | 60 | | | v1.30.4 | [ubuntu-2204-kube-v1.30.4.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.4.qcow2) | [ubuntu-2204-kube-v1.30.4.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.4.qcow2.CHECKSUM) | 61 | | | v1.30.3 | [ubuntu-2204-kube-v1.30.3.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.3.qcow2) | [ubuntu-2204-kube-v1.30.3.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.3.qcow2.CHECKSUM) | 62 | | | v1.30.2 | [ubuntu-2204-kube-v1.30.2.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.2.qcow2) | [ubuntu-2204-kube-v1.30.2.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.2.qcow2.CHECKSUM) | 63 | | | v1.30.1 | [ubuntu-2204-kube-v1.30.1.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.1.qcow2) | [ubuntu-2204-kube-v1.30.1.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.1.qcow2.CHECKSUM) | 64 | | | v1.30.0 | [ubuntu-2204-kube-v1.30.0.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.0.qcow2) | [ubuntu-2204-kube-v1.30.0.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.30/ubuntu-2204-kube-v1.30.0.qcow2.CHECKSUM) | 65 | 66 | ## Ubuntu 22.04 (Archived) 67 | 68 | | Series | Version | Image URL | CHECKSUM URL | 69 | |--------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 70 | | v1.29 | | | | 71 | | | v1.29.15 | [ubuntu-2204-kube-v1.29.15.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.29/ubuntu-2204-kube-v1.29.15.qcow2) | [ubuntu-2204-kube-v1.29.15.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.29/ubuntu-2204-kube-v1.29.15.qcow2.CHECKSUM) | 72 | | v1.28 | | | | 73 | | | v1.28.15 | [ubuntu-2204-kube-v1.28.15.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.28/ubuntu-2204-kube-v1.28.15.qcow2) | [ubuntu-2204-kube-v1.28.15.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.28/ubuntu-2204-kube-v1.28.15.qcow2.CHECKSUM) | 74 | | v1.27 | | | | 75 | | | v1.27.15 | [ubuntu-2204-kube-v1.27.15.qcow2](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.27/ubuntu-2204-kube-v1.27.15.qcow2) | [ubuntu-2204-kube-v1.27.15.qcow2.CHECKSUM](https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.27/ubuntu-2204-kube-v1.27.15.qcow2.CHECKSUM) | 76 | 77 | ## Helpful prompts 78 | 79 | * Add the current Kubernetes versions as defined by kubernetes_semver in the files named like 80 | extra_vars_130.json to the README.md file. 81 | -------------------------------------------------------------------------------- /extra_vars_130.json: -------------------------------------------------------------------------------- 1 | { 2 | "iso_checksum": "9bc6028870aef3f74f4e16b900008179e78b130e6b0b9a140635434a46aa98b0", 3 | "iso_url": "https://releases.ubuntu.com/releases/22.04/ubuntu-22.04.5-live-server-amd64.iso", 4 | "kubernetes_deb_version": "1.30.13-1.1", 5 | "kubernetes_semver": "v1.30.13", 6 | "kubernetes_series": "v1.30", 7 | "output_directory": "./output/{{user `build_name`}}-kube-{{user `kubernetes_series`}}" 8 | } 9 | -------------------------------------------------------------------------------- /extra_vars_131.json: -------------------------------------------------------------------------------- 1 | { 2 | "iso_checksum": "9bc6028870aef3f74f4e16b900008179e78b130e6b0b9a140635434a46aa98b0", 3 | "iso_url": "https://releases.ubuntu.com/releases/22.04/ubuntu-22.04.5-live-server-amd64.iso", 4 | "kubernetes_deb_version": "1.31.9-1.1", 5 | "kubernetes_semver": "v1.31.9", 6 | "kubernetes_series": "v1.31", 7 | "output_directory": "./output/{{user `build_name`}}-kube-{{user `kubernetes_series`}}" 8 | } 9 | -------------------------------------------------------------------------------- /extra_vars_132.json: -------------------------------------------------------------------------------- 1 | { 2 | "iso_checksum": "9bc6028870aef3f74f4e16b900008179e78b130e6b0b9a140635434a46aa98b0", 3 | "iso_url": "https://releases.ubuntu.com/releases/22.04/ubuntu-22.04.5-live-server-amd64.iso", 4 | "kubernetes_deb_version": "1.32.5-1.1", 5 | "kubernetes_semver": "v1.32.5", 6 | "kubernetes_series": "v1.32", 7 | "output_directory": "./output/{{user `build_name`}}-kube-{{user `kubernetes_series`}}" 8 | } 9 | -------------------------------------------------------------------------------- /extra_vars_133.json: -------------------------------------------------------------------------------- 1 | { 2 | "iso_checksum": "9bc6028870aef3f74f4e16b900008179e78b130e6b0b9a140635434a46aa98b0", 3 | "iso_url": "https://releases.ubuntu.com/releases/22.04/ubuntu-22.04.5-live-server-amd64.iso", 4 | "kubernetes_deb_version": "1.33.1-1.1", 5 | "kubernetes_semver": "v1.33.1", 6 | "kubernetes_series": "v1.33", 7 | "output_directory": "./output/{{user `build_name`}}-kube-{{user `kubernetes_series`}}" 8 | } 9 | -------------------------------------------------------------------------------- /playbooks/build.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Build image 3 | # hosts: all 4 | hosts: localhost 5 | connection: local 6 | 7 | vars: 8 | distro: "{{ lookup('ansible.builtin.env', 'DISTRO', default='ubuntu') }}" 9 | distro_version: "{{ lookup('ansible.builtin.env', 'DISTRO_VERSION', default='2204') }}" 10 | extra_vars_openstack_directory: "{{ repo_path }}/osism/k8s-capi-images" 11 | kubernetes_version: "{{ lookup('ansible.builtin.env', 'KUBERNETES_VERSION', default='124') }}" 12 | repo_path: "{{ ansible_user_dir|default('~') }}/src/github.com" 13 | working_directory: "{{ repo_path }}/kubernetes-sigs/image-builder/images/capi" 14 | 15 | tasks: 16 | - name: Run build script 17 | ansible.builtin.shell: 18 | executable: /bin/bash 19 | chdir: "{{ working_directory }}" 20 | cmd: | 21 | set -e 22 | set -x 23 | 24 | export PACKER_VAR_FILES={{ extra_vars_openstack_directory }}/extra_vars_openstack_{{ distro }}_{{ kubernetes_version }}.json 25 | export PATH=~/.local/bin:$PATH 26 | 27 | make build-qemu-{{ distro }}-{{ distro_version }} 28 | -------------------------------------------------------------------------------- /playbooks/post.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Build image 3 | # hosts: all 4 | hosts: localhost 5 | connection: local 6 | 7 | vars: 8 | repo_path: "{{ ansible_user_dir|default('~') }}/src/github.com" 9 | upload_image: false 10 | 11 | tasks: 12 | - name: Run upload script 13 | ansible.builtin.shell: 14 | executable: /bin/bash 15 | chdir: "{{ repo_path }}/kubernetes-sigs/image-builder/images/capi/output" 16 | cmd: | 17 | find . -type f -execdir bash -c 'x={}; cp $x ${x%.*}.qcow2; mv $x $x.qcow2' \; 18 | wget https://dl.min.io/client/mc/release/linux-amd64/mc 19 | chmod +x mc 20 | ./mc alias set minio https://minio.services.osism.tech {{ minio.MINIO_ACCESS_KEY | trim }} {{ minio.MINIO_SECRET_KEY | trim }} 21 | ./mc cp --recursive image-builder/images/capi/output/* minio/openstack-k8s-capi-images 22 | ./mc policy set download minio/openstack-k8s-capi-images 23 | when: upload_image|bool 24 | no_log: true 25 | -------------------------------------------------------------------------------- /playbooks/pre.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Pre tasks - part 1 3 | # hosts: all 4 | hosts: localhost 5 | connection: local 6 | 7 | vars: 8 | working_directory: "{{ zuul.project.src_dir|default('~') }}" 9 | 10 | tasks: 11 | - name: Run install script 12 | ansible.builtin.shell: 13 | executable: /bin/bash 14 | chdir: "{{ working_directory }}" 15 | cmd: | 16 | set -e 17 | set -x 18 | 19 | while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do sleep 5; done; 20 | while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do sleep 5; done; 21 | 22 | sudo apt-get update 23 | sudo apt-get install -y \ 24 | curl \ 25 | git \ 26 | jq \ 27 | libguestfs-tools \ 28 | make \ 29 | patch \ 30 | python3-pip \ 31 | qemu-kvm \ 32 | software-properties-common \ 33 | unzip 34 | 35 | sudo chmod 0777 /dev/kvm 36 | 37 | echo "Host *" | sudo tee /etc/ssh/ssh_config 38 | echo " PubkeyAcceptedAlgorithms +ssh-rsa" | sudo tee /etc/ssh/ssh_config 39 | echo " HostkeyAlgorithms +ssh-rsa" | sudo tee /etc/ssh/ssh_config 40 | 41 | lsmod 42 | 43 | 44 | # Only required by Zuul CI. 45 | # 46 | # - name: Pre roles 47 | # hosts: all 48 | # 49 | # vars: 50 | # install_packer: false 51 | # install_pip: false 52 | # 53 | # roles: 54 | # - role: ensure-packer 55 | # vars: 56 | # packer_version: "1.8.6" 57 | # when: install_packer|bool 58 | # 59 | # - role: ensure-pip 60 | # when: install_pip|bool 61 | 62 | - name: Pre tasks - part 2 63 | # hosts: all 64 | hosts: localhost 65 | connection: local 66 | 67 | vars: 68 | ppg_version: "3.1.4" # packer-provisioner-goss 69 | working_directory: "{{ zuul.project.src_dir|default('~') }}" 70 | 71 | tasks: 72 | - name: Run install script 73 | ansible.builtin.shell: 74 | executable: /bin/bash 75 | chdir: "{{ working_directory }}" 76 | cmd: | 77 | set -e 78 | set -x 79 | 80 | wget \ 81 | -O packer-provisioner-goss.zip \ 82 | https://github.com/YaleUniversity/packer-provisioner-goss/releases/download/v{{ ppg_version }}/packer-provisioner-goss-v{{ ppg_version }}-linux-amd64.zip 83 | unzip packer-provisioner-goss.zip -d /tmp 84 | mkdir -p ~/.packer.d/plugins 85 | mv /tmp/packer-provisioner-goss ~/.packer.d/plugins 86 | -------------------------------------------------------------------------------- /scripts/run-update-extra-vars.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | for filename in $(echo extra_vars_*.json); do 4 | python3 src/update-extra-vars.py $filename; 5 | done 6 | -------------------------------------------------------------------------------- /src/update-extra-vars.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # 3 | # Script to fetch the latest version of kubernetes by the given file. 4 | # 5 | ############################################################################### 6 | 7 | import json 8 | import sys 9 | import urllib.parse 10 | import urllib.request 11 | 12 | 13 | ############################################################################### 14 | # Variables 15 | ############################################################################### 16 | 17 | github_api = "https://api.github.com/repos/kubernetes/kubernetes/tags" 18 | file = sys.argv[1] 19 | 20 | 21 | ############################################################################### 22 | # Functions 23 | ############################################################################### 24 | 25 | 26 | def load_file(file): 27 | with open(file) as json_load_file: 28 | data = json.load(json_load_file) 29 | return data 30 | 31 | 32 | def traverse_pagination(): 33 | # check, how many pages can be traversed by using the mozilla header 34 | # more information: 35 | # https://docs.github.com/en/rest/guides/traversing-with-pagination 36 | query_url = github_api + "?q=addClass+user:mozilla&per_page=100" 37 | with urllib.request.urlopen(query_url) as url: 38 | result = url.getheader("link") 39 | 40 | # turn this answer 41 | # ; rel="next", ; rel\ 44 | # ="last" 45 | # into a list 46 | # [ 47 | # '; rel', 51 | # '"next" ; rel', 55 | # '"last"' 56 | # ] 57 | result = result.split("=") 58 | # get only the 8th entry: '8>; rel' 59 | result = result[7] 60 | # strip away the html stuff to get only the number of pages 61 | result = result.split(">")[0] 62 | 63 | return int(result) 64 | 65 | 66 | def update_version(data): 67 | new_version = "v0.0.0" 68 | versions_list = [] 69 | number_of_pages = traverse_pagination() 70 | 71 | # loop number of pages and query 100 tags each time 72 | # and break, if we found a matching tag to avoid too much api queries 73 | for page in range(number_of_pages): 74 | query_url = github_api + "?per_page=100&page=" + str(page) 75 | with urllib.request.urlopen(query_url) as url: 76 | # check the 100 tags if they are valid and append 77 | # them to the list "versions" 78 | for entry in json.loads(url.read().decode()): 79 | if ( 80 | "rc" not in entry["name"] 81 | and "alpha" not in entry["name"] 82 | and "beta" not in entry["name"] 83 | ): 84 | versions_list.append(entry["name"]) 85 | 86 | # find the first entry in version_list that matches 87 | # the series (v1.28 matches v1.28.3) 88 | for entry in versions_list: 89 | if data["kubernetes_series"] in entry: 90 | new_version = entry 91 | break 92 | 93 | # if new_version is set, a match was found. The page loop can be 94 | # exited by a break. 95 | # otherwise the loop will continue and search for a match. 96 | if not new_version == "v0.0.0": 97 | break 98 | 99 | # check if we really found a match 100 | if not new_version == "v0.0.0": 101 | # e.g. 1.28.2-1.1 102 | data["kubernetes_deb_version"] = new_version[1:] + "-1.1" 103 | # e.g. v1.28.2 104 | data["kubernetes_semver"] = new_version 105 | # e.g. v1.28 106 | data["kubernetes_series"] = ( 107 | new_version.split(".")[0] + "." + new_version.split(".")[1] 108 | ) 109 | 110 | return data 111 | 112 | 113 | def dump_file(file, data): 114 | with open(file, "w") as fp: 115 | json.dump(data, fp, indent=4, sort_keys=True) 116 | fp.write("\n") 117 | 118 | 119 | ############################################################################### 120 | # Main 121 | ############################################################################### 122 | 123 | original_data = load_file(file) 124 | updated_data = update_version(original_data) 125 | dump_file(file, updated_data) 126 | --------------------------------------------------------------------------------