#!/bin/bash # Copyright 2024 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -o errexit set -o nounset set -o pipefail REPO_ROOT="$(git rev-parse --show-toplevel)" cd "${REPO_ROOT}" function generate_k8s_hashes() { prefix=$1 max_patch=$2 cat > "${REPO_ROOT}/pkg/assets/assetdata/k8s-${prefix}.yaml" <> "${REPO_ROOT}/pkg/assets/assetdata/k8s-${prefix}.yaml" done } function generate_runc_hashes() { prefix=$1 max_patch=$2 cat > "${REPO_ROOT}/pkg/assets/assetdata/runc-${prefix}.yaml" <> "${REPO_ROOT}/pkg/assets/assetdata/runc-${prefix}.yaml" done } function generate_containerd_hashes() { prefix=$1 max_patch=$2 cat > "${REPO_ROOT}/pkg/assets/assetdata/containerd-${prefix}.yaml" <> "${REPO_ROOT}/pkg/assets/assetdata/containerd-${prefix}.yaml" done } function generate_cni_hashes() { prefix=$1 patch=$2 cat > "${REPO_ROOT}/pkg/assets/assetdata/cni-${prefix}.yaml" <> "${REPO_ROOT}/pkg/assets/assetdata/cni-${prefix}.yaml" } # Generate k8s hashes. # The first argument is the major and minor version, the second is the maximum patch version. generate_k8s_hashes 1.25 16 generate_k8s_hashes 1.26 15 generate_k8s_hashes 1.27 16 generate_k8s_hashes 1.28 15 generate_k8s_hashes 1.29 12 generate_k8s_hashes 1.30 8 generate_k8s_hashes 1.31 4 generate_k8s_hashes 1.32 0 # Generate runc hashes. # The first argument is the major and minor version, the second is the maximum patch version. generate_runc_hashes 1.1 15 generate_runc_hashes 1.2 4 # Generate containerd hashes. generate_containerd_hashes 1.7 25 generate_containerd_hashes 2.0 1 # Generate CNI network plugins hashes. generate_cni_hashes 0.9 1 generate_cni_hashes 1.2 0 generate_cni_hashes 1.3 0 generate_cni_hashes 1.4 1 generate_cni_hashes 1.5 1 generate_cni_hashes 1.6 1