Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions roles/kubespray_defaults/defaults/main/download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ image_info_command_on_localhost: "{{ lookup('vars', image_command_tool_on_localh

# Arch of Docker images and needed packages
image_arch: "{{ host_architecture | default('amd64') }}"
alt_image_arch: "{{ alt_host_arch | default('x86_64') }}"

# Versions
crun_version: "{{ (crun_checksums['amd64'] | dict2items)[0].key }}"
Expand Down Expand Up @@ -166,7 +167,7 @@ crio_download_url: "{{ storage_googleapis_url }}/cri-o/artifacts/cri-o.{{ image_
helm_download_url: "{{ get_helm_url }}/helm-v{{ helm_version }}-linux-{{ image_arch }}.tar.gz"
runc_download_url: "{{ github_url }}/opencontainers/runc/releases/download/v{{ runc_version }}/runc.{{ image_arch }}"
crun_download_url: "{{ github_url }}/containers/crun/releases/download/{{ crun_version }}/crun-{{ crun_version }}-linux-{{ image_arch }}"
youki_download_url: "{{ github_url }}/youki-dev/youki/releases/download/v{{ youki_version }}/youki-{{ youki_version }}-{{ ansible_architecture }}-gnu.tar.gz"
youki_download_url: "{{ github_url }}/youki-dev/youki/releases/download/v{{ youki_version }}/youki-{{ youki_version }}-{{ alt_image_arch }}-gnu.tar.gz"
kata_containers_download_url: "{{ github_url }}/kata-containers/kata-containers/releases/download/{{ kata_containers_version }}/kata-static-{{ kata_containers_version }}-{{ image_arch }}.tar.xz"
# gVisor only supports amd64 and uses x86_64 to in the download link
gvisor_runsc_download_url: "{{ storage_googleapis_url }}/gvisor/releases/release/{{ gvisor_version }}/{{ ansible_architecture }}/runsc"
Expand Down Expand Up @@ -522,7 +523,7 @@ downloads:
youki:
file: true
enabled: "{{ youki_enabled }}"
dest: "{{ local_release_dir }}/youki-{{ youki_version }}-{{ ansible_architecture }}.tar.gz"
dest: "{{ local_release_dir }}/youki-{{ youki_version }}-{{ alt_image_arch }}.tar.gz"
checksum: "{{ youki_archive_checksum }}"
url: "{{ youki_download_url }}"
unarchive: true
Expand Down
10 changes: 10 additions & 0 deletions roles/kubespray_defaults/defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,16 @@ host_architecture: >-
{{ ansible_architecture }}
{%- endif -%}

_alt_arch_name:
amd64: x86_64
arm64: aarch64
alt_host_arch: >-
{%- if ansible_architecture in _alt_arch_name -%}
{{ _alt_arch_name[ansible_architecture] }}
{%- else -%}
{{ ansible_architecture }}
{%- endif -%}
Comment on lines +737 to +742
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't bother with that, this would only mask errors.
just setup the dict, and if you can have one entry for each supported arch for youki that should be enough.
Then just use alt_arch_name[ansible_architecture] directly on use site.


_host_os_groups:
Linux: linux
Darwin: darwin
Expand Down