Skip to content

Commit

Permalink
krew: update to v0.4.2 (#8168)
Browse files Browse the repository at this point in the history
krew release urls changed since v0.4.2, clearly OS type and arch inside the filename.

from:
  https://github.com/kubernetes-sigs/krew/releases/download/v0.4.1/krew.tar.gz
to:
  https://github.com/kubernetes-sigs/krew/releases/download/v0.4.2/krew-linux_amd64.tar.gz

define `host_os` like `host_architecture` determine which OS is krew
installed at.
  • Loading branch information
zhengtianbao authored Nov 8, 2021
1 parent 6c1ab24 commit 65540c5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 12 deletions.
31 changes: 26 additions & 5 deletions roles/download/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ovn4nfv_ovn_image_version: "v1.0.0"
ovn4nfv_k8s_plugin_image_version: "v1.1.0"
helm_version: "v3.7.0"
nerdctl_version: "0.12.1"
krew_version: "v0.4.1"
krew_version: "v0.4.2"

# Get kubernetes major version (i.e. 1.17.4 => 1.17)
kube_major_version: "{{ kube_version | regex_replace('^v([0-9])+\\.([0-9]+)\\.[0-9]+', 'v\\1.\\2') }}"
Expand All @@ -118,7 +118,7 @@ kata_containers_download_url: "https://github.com/kata-containers/kata-container
gvisor_runsc_download_url: "https://storage.googleapis.com/gvisor/releases/release/{{ gvisor_version }}/{{ ansible_architecture }}/runsc"
gvisor_containerd_shim_runsc_download_url: "https://storage.googleapis.com/gvisor/releases/release/{{ gvisor_version }}/{{ ansible_architecture }}/containerd-shim-runsc-v1"
nerdctl_download_url: "https://github.com/containerd/nerdctl/releases/download/v{{ nerdctl_version }}/nerdctl-{{ nerdctl_version }}-{{ ansible_system | lower }}-{{ image_arch }}.tar.gz"
krew_download_url: "https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew.tar.gz"
krew_download_url: "https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz"
containerd_download_url: "https://github.com/containerd/containerd/releases/download/v{{ containerd_version }}/containerd-{{ containerd_version }}-linux-{{ image_arch }}.tar.gz"

crictl_checksums:
Expand Down Expand Up @@ -395,7 +395,28 @@ calico_crds_archive_checksums:
v3.18.5: ed7065c5a90b71cf7b3b525d5107a4573bd051c3ff004a56ab6017c222b3e2d6

krew_archive_checksums:
v0.4.1: a26deea175f70264260d59a4e061778a892f8a8e301ac261660dd7d24c551c99
linux:
arm:
v0.4.2: 115f503e35ef7f63f00a9b01236d80a9f94862ec684010a81c3a3b51bdca1351
arm64:
v0.4.2: 7581be80d803536acc63cceb20065023b96f07fd7eb9f4ee495dce0294a866eb
amd64:
v0.4.2: 203bfd8006b304c1e58d9e96f9afdc5f4a055e0fbd7ee397fac9f36bf202e721
darwin:
arm:
v0.4.2: 0
arm64:
v0.4.2: a69d48f8cad7d87b379071129cde3ee4abcaaa1c3f3692bc80887178b2cc7d33
amd64:
v0.4.2: 47c6b5b647c5de679a2302444f75a36a70530fa4751cb655e0edd5da56a5f110
windows:
arm:
v0.4.2: 0
arm64:
v0.4.2: 0
amd64:
v0.4.2: 3150ff0291ac876ebe4fe0e813ee90a18aa2bc0510c3adcfae6117dec44ef269


helm_archive_checksums:
arm:
Expand Down Expand Up @@ -506,7 +527,7 @@ kata_containers_binary_checksum: "{{ kata_containers_binary_checksums[image_arch
gvisor_runsc_binary_checksum: "{{ gvisor_runsc_binary_checksums[image_arch][gvisor_version] }}"
gvisor_containerd_shim_binary_checksum: "{{ gvisor_containerd_shim_binary_checksums[image_arch][gvisor_version] }}"
nerdctl_archive_checksum: "{{ nerdctl_archive_checksums[image_arch][nerdctl_version] }}"
krew_archive_checksum: "{{ krew_archive_checksums[krew_version] }}"
krew_archive_checksum: "{{ krew_archive_checksums[host_os][image_arch][krew_version] }}"
containerd_archive_checksum: "{{ containerd_archive_checksums[image_arch][containerd_version] }}"

# Containers
Expand Down Expand Up @@ -1106,7 +1127,7 @@ downloads:
enabled: "{{ krew_enabled }}"
file: true
version: "{{ krew_version }}"
dest: "{{ local_release_dir }}/krew.tar.gz"
dest: "{{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz"
sha256: "{{ krew_archive_checksum }}"
url: "{{ krew_download_url }}"
unarchive: true
Expand Down
2 changes: 1 addition & 1 deletion roles/kubernetes-apps/krew/tasks/krew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
dest: "{{ local_release_dir }}/krew.yml"

- name: Krew | Install krew # noqa 301 305
shell: "{{ local_release_dir }}/krew-linux_{{ image_arch }} install --archive={{ local_release_dir }}/krew.tar.gz --manifest={{ local_release_dir }}/krew.yml"
shell: "{{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }} install --archive={{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz --manifest={{ local_release_dir }}/krew.yml"
environment:
KREW_ROOT: "{{ krew_root_dir }}"
KREW_DEFAULT_INDEX_URI: "{{ krew_default_index_uri | default('') }}"
12 changes: 6 additions & 6 deletions roles/kubernetes-apps/krew/templates/krew.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
https://krew.sigs.k8s.io/docs/user-guide/quickstart/.

platforms:
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew.tar.gz
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz
sha256: {{ krew_archive_checksum }}
bin: krew
files:
Expand All @@ -38,7 +38,7 @@ spec:
matchLabels:
os: darwin
arch: amd64
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew.tar.gz
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz
sha256: {{ krew_archive_checksum }}
bin: krew
files:
Expand All @@ -50,7 +50,7 @@ spec:
matchLabels:
os: darwin
arch: arm64
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew.tar.gz
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz
sha256: {{ krew_archive_checksum }}
bin: krew
files:
Expand All @@ -62,7 +62,7 @@ spec:
matchLabels:
os: linux
arch: amd64
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew.tar.gz
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz
sha256: {{ krew_archive_checksum }}
bin: krew
files:
Expand All @@ -74,7 +74,7 @@ spec:
matchLabels:
os: linux
arch: arm
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew.tar.gz
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz
sha256: {{ krew_archive_checksum }}
bin: krew
files:
Expand All @@ -86,7 +86,7 @@ spec:
matchLabels:
os: linux
arch: arm64
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew.tar.gz
- uri: https://github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz
sha256: {{ krew_archive_checksum }}
bin: krew.exe
files:
Expand Down
11 changes: 11 additions & 0 deletions roles/kubespray-defaults/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,17 @@ host_architecture: >-
{{ ansible_architecture }}
{%- endif -%}
_host_os_groups:
Linux: linux
Darwin: darwin
Win32NT: windows
host_os: >-
{%- if ansible_system in _host_os_groups -%}
{{ _host_os_groups[ansible_system] }}
{%- else -%}
{{ ansible_system }}
{%- endif -%}
# Sets the eventRecordQPS parameter in kubelet-config.yaml. The default value is 5 (see types.go)
# Setting it to 0 allows unlimited requests per second.
kubelet_event_record_qps: 5
Expand Down

0 comments on commit 65540c5

Please sign in to comment.