mirror of https://github.com/kubernetes/kops.git
Add CNI network plugins hashes
This commit is contained in:
parent
bc4eb919cf
commit
24283dec52
|
|
@ -88,6 +88,35 @@ EOF
|
|||
done
|
||||
}
|
||||
|
||||
function generate_cni_hashes() {
|
||||
prefix=$1
|
||||
patch=$2
|
||||
|
||||
cat > "${REPO_ROOT}/pkg/assets/assetdata/cni-${prefix}.yaml" <<EOF
|
||||
# This file is generated by generate-asset-hashes.sh
|
||||
|
||||
filestores:
|
||||
- base: https://storage.googleapis.com/k8s-artifacts-cni/release/
|
||||
|
||||
files:
|
||||
EOF
|
||||
|
||||
version="${prefix}.${patch}"
|
||||
echo "cni ${version}"
|
||||
|
||||
# We exclude some files that we don't currently need, to keep the size down
|
||||
go run ./pkg/assets/assetdata/tools/cmd/generatefileassets \
|
||||
--base https://storage.googleapis.com/k8s-artifacts-cni/release/ \
|
||||
--prefix "v${version}/" \
|
||||
--sums "https://storage.googleapis.com/k8s-artifacts-cni/release/v${version}/cni-plugins-linux-amd64-v${version}.tgz.sha256" \
|
||||
| sed "s@files:@# cni ${version}@g" >> "${REPO_ROOT}/pkg/assets/assetdata/cni-${prefix}.yaml"
|
||||
go run ./pkg/assets/assetdata/tools/cmd/generatefileassets \
|
||||
--base https://storage.googleapis.com/k8s-artifacts-cni/release/ \
|
||||
--prefix "v${version}/" \
|
||||
--sums "https://storage.googleapis.com/k8s-artifacts-cni/release/v${version}/cni-plugins-linux-arm64-v${version}.tgz.sha256" \
|
||||
| sed "s@files:@# cni ${version}@g" >> "${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
|
||||
|
|
@ -102,3 +131,11 @@ generate_k8s_hashes 1.31 3
|
|||
# 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 3
|
||||
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
# This file is generated by generate-asset-hashes.sh
|
||||
|
||||
filestores:
|
||||
- base: https://storage.googleapis.com/k8s-artifacts-cni/release/
|
||||
|
||||
files:
|
||||
# cni 0.9.1
|
||||
- name: v0.9.1/cni-plugins-linux-amd64-v0.9.1.tgz
|
||||
sha256: 962100bbc4baeaaa5748cdbfce941f756b1531c2eadb290129401498bfac21e7
|
||||
# cni 0.9.1
|
||||
- name: v0.9.1/cni-plugins-linux-arm64-v0.9.1.tgz
|
||||
sha256: ef17764ffd6cdcb16d76401bac1db6acc050c9b088f1be5efa0e094ea3b01df0
|
||||
|
||||
- name: v1.2.0/cni-plugins-linux-amd64-v1.2.0.tgz
|
||||
sha256: f3a841324845ca6bf0d4091b4fc7f97e18a623172158b72fc3fdcdb9d42d2d37
|
||||
- name: v1.2.0/cni-plugins-linux-arm64-v1.2.0.tgz
|
||||
sha256: 525e2b62ba92a1b6f3dc9612449a84aa61652e680f7ebf4eff579795fe464b57
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# This file is generated by generate-asset-hashes.sh
|
||||
|
||||
filestores:
|
||||
- base: https://storage.googleapis.com/k8s-artifacts-cni/release/
|
||||
|
||||
files:
|
||||
# cni 1.2.0
|
||||
- name: v1.2.0/cni-plugins-linux-amd64-v1.2.0.tgz
|
||||
sha256: f3a841324845ca6bf0d4091b4fc7f97e18a623172158b72fc3fdcdb9d42d2d37
|
||||
# cni 1.2.0
|
||||
- name: v1.2.0/cni-plugins-linux-arm64-v1.2.0.tgz
|
||||
sha256: 525e2b62ba92a1b6f3dc9612449a84aa61652e680f7ebf4eff579795fe464b57
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# This file is generated by generate-asset-hashes.sh
|
||||
|
||||
filestores:
|
||||
- base: https://storage.googleapis.com/k8s-artifacts-cni/release/
|
||||
|
||||
files:
|
||||
# cni 1.3.0
|
||||
- name: v1.3.0/cni-plugins-linux-amd64-v1.3.0.tgz
|
||||
sha256: 754a71ed60a4bd08726c3af705a7d55ee3df03122b12e389fdba4bea35d7dd7e
|
||||
# cni 1.3.0
|
||||
- name: v1.3.0/cni-plugins-linux-arm64-v1.3.0.tgz
|
||||
sha256: de7a666fd6ad83a228086bd55756db62ef335a193d1b143d910b69f079e30598
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# This file is generated by generate-asset-hashes.sh
|
||||
|
||||
filestores:
|
||||
- base: https://storage.googleapis.com/k8s-artifacts-cni/release/
|
||||
|
||||
files:
|
||||
# cni 1.4.1
|
||||
- name: v1.4.1/cni-plugins-linux-amd64-v1.4.1.tgz
|
||||
sha256: 1511f6c003ace805eafeb1132727791326283cff88a923d76329e1892bba7a10
|
||||
# cni 1.4.1
|
||||
- name: v1.4.1/cni-plugins-linux-arm64-v1.4.1.tgz
|
||||
sha256: 72644e13557cda8a5b39baf97fc5e93d23fdf7baba7700000e7e9efd8bdf9234
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# This file is generated by generate-asset-hashes.sh
|
||||
|
||||
filestores:
|
||||
- base: https://storage.googleapis.com/k8s-artifacts-cni/release/
|
||||
|
||||
files:
|
||||
# cni 1.5.1
|
||||
- name: v1.5.1/cni-plugins-linux-amd64-v1.5.1.tgz
|
||||
sha256: 77baa2f669980a82255ffa2f2717de823992480271ee778aa51a9c60ae89ff9b
|
||||
# cni 1.5.1
|
||||
- name: v1.5.1/cni-plugins-linux-arm64-v1.5.1.tgz
|
||||
sha256: c2a292714d0fad98a3491ae43df8ad58354b3c0bdf5d5a3e281777967c70fcff
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# This file is generated by generate-asset-hashes.sh
|
||||
|
||||
filestores:
|
||||
- base: https://storage.googleapis.com/k8s-artifacts-cni/release/
|
||||
|
||||
files:
|
||||
# cni 1.6.1
|
||||
- name: v1.6.1/cni-plugins-linux-amd64-v1.6.1.tgz
|
||||
sha256: 2503ce29ac445715ebe146073f45468153f9e28f45fa173cb060cfd9e735f563
|
||||
# cni 1.6.1
|
||||
- name: v1.6.1/cni-plugins-linux-arm64-v1.6.1.tgz
|
||||
sha256: f0f440b968ab50ad13d9d42d993ba98ec30b2ec666846f4ef1bddc7646a701cc
|
||||
|
|
@ -40,6 +40,12 @@ var wellKnownMirrors = []mirrorConfig{
|
|||
"https://github.com/kubernetes/kops/releases/download/v{kopsVersion}/",
|
||||
},
|
||||
},
|
||||
{
|
||||
Base: "https://storage.googleapis.com/k8s-artifacts-cni/release/",
|
||||
Mirrors: []string{
|
||||
"https://github.com/containernetworking/plugins/releases/download/",
|
||||
},
|
||||
},
|
||||
{
|
||||
Base: "https://dl.k8s.io/release/",
|
||||
Mirrors: []string{
|
||||
|
|
@ -65,10 +71,10 @@ func (m *mirrorConfig) findMirrors(u string) ([]string, bool) {
|
|||
mirrors := []string{u}
|
||||
|
||||
for _, mirror := range m.Mirrors {
|
||||
mirror = strings.ReplaceAll(mirror, "{kopsVersion}", kops.Version)
|
||||
suffix := strings.TrimPrefix(u, baseURLString)
|
||||
|
||||
if strings.HasPrefix(mirror, "https://github.com") {
|
||||
if strings.HasPrefix(mirror, "https://github.com") && strings.Contains(mirror, "/kops/") {
|
||||
mirror = strings.ReplaceAll(mirror, "{kopsVersion}", kops.Version)
|
||||
// GitHub artifact names are quite different, because the suffix path is collapsed.
|
||||
suffix = strings.ReplaceAll(suffix, "/", "-")
|
||||
suffix = strings.ReplaceAll(suffix, "linux-amd64-nodeup", "nodeup-linux-amd64")
|
||||
|
|
@ -78,6 +84,7 @@ func (m *mirrorConfig) findMirrors(u string) ([]string, bool) {
|
|||
suffix = strings.ReplaceAll(suffix, "linux-amd64-channels", "channels-linux-amd64")
|
||||
suffix = strings.ReplaceAll(suffix, "linux-arm64-channels", "channels-linux-arm64")
|
||||
}
|
||||
|
||||
mirrors = append(mirrors, mirror+suffix)
|
||||
}
|
||||
return mirrors, true
|
||||
|
|
|
|||
Loading…
Reference in New Issue