fix: add configuration value for binary flavors (linux-amd64)
Refs salt-formulas/salt-formula-helm#2
diff --git a/helm/client_installed.sls b/helm/client_installed.sls
index c632b52..d1fc179 100644
--- a/helm/client_installed.sls
+++ b/helm/client_installed.sls
@@ -8,7 +8,7 @@
- user: root
- group: root
archive.extracted:
- - source: https://storage.googleapis.com/kubernetes-helm/helm-v{{ config.version }}-linux-amd64.tar.gz
+ - source: https://storage.googleapis.com/kubernetes-helm/helm-v{{ config.version }}-{{ config.flavor }}.tar.gz
- source_hash: {{ config.download_hash }}
- archive_format: tar
{%- if grains['saltversioninfo'] < [2016, 11] %}
@@ -16,13 +16,13 @@
{%- else %}
- options: v
{%- endif %}
- - if_missing: {{ constants.helm.tmp }}/linux-amd64/helm
+ - if_missing: {{ constants.helm.tmp }}/{{ config.flavor }}/helm
- require:
- file: {{ constants.helm.tmp }}
{{ constants.helm.bin }}:
file.managed:
- - source: {{ constants.helm.tmp }}/linux-amd64/helm
+ - source: {{ constants.helm.tmp }}/{{ config.flavor }}/helm
- mode: 555
- user: root
- group: root
diff --git a/helm/kubectl_installed.sls b/helm/kubectl_installed.sls
index 298c8e9..f7e0719 100644
--- a/helm/kubectl_installed.sls
+++ b/helm/kubectl_installed.sls
@@ -4,7 +4,7 @@
extract_kubectl:
archive.extracted:
- name: {{ constants.helm.tmp }}/kubectl/v{{ config.kubectl.version }}
- - source: https://dl.k8s.io/v{{ config.kubectl.version }}/kubernetes-client-linux-amd64.tar.gz
+ - source: https://dl.k8s.io/v{{ config.kubectl.version }}/kubernetes-client-{{ config.flavor }}.tar.gz
- source_hash: {{ config.kubectl.download_hash }}
- archive_format: tar
{%- if grains['saltversioninfo'] < [2016, 11] %}
diff --git a/helm/map.jinja b/helm/map.jinja
index 3c8e70c..794521a 100644
--- a/helm/map.jinja
+++ b/helm/map.jinja
@@ -29,6 +29,7 @@
helm:
client:
version: 2.6.2
+ flavor: linux-amd64
download_hash: sha256=ba807d6017b612a0c63c093a954c7d63918d3e324bdba335d67b7948439dbca8
# TODO: add parameter for binary installation flavor
#
diff --git a/pillar.example b/pillar.example
index 6ad80a9..bb0e2fa 100644
--- a/pillar.example
+++ b/pillar.example
@@ -7,14 +7,26 @@
# version: 2.6.2
#
+ # The flavor of the helm or kubectl binary to install, as informed by the
+ # target minion's OS. For available flavor names, peruse the listing of
+ # Helm binaries exposed at:
+ #
+ # https://storage.googleapis.com/kubernetes-helm
+ #
+ # Defaults to linux-amd64
+ #
+ # flavor: linux-amd64
+
+ #
# The hash for the helm client binary. You must calculate the hash for the
- # version of the binary you install.
- # Defaults to the SHA 256 hash for the helm-v2.6.2-linux-amd64.tar.gz
+ # version and flavor of the binary you install (per the helm:client:flavor
+ # configuration value)
+ # Defaults to the SHA 256 hash for the helm-v2.6.2-linux-amd64.tar.gz binary
#
#
# The binary is downloaded from:
#
- # https://storage.googleapis.com/kubernetes-helm/helm-v[[ client.version ]]-linux-amd64.tar.gz
+ # https://storage.googleapis.com/kubernetes-helm/helm-v[[ client.version ]]-[[ client.flavor ]].tar.gz
#
# Here is an example command you can use to calculate the sha256 hash for
# the binary:
@@ -67,12 +79,13 @@
#
# The hash for the kubectl binary version to install. You must calculate
- # the hash for the version of the binary you install.
+ # the hash for the version and flavor of the binary you install (per the
+ # helm:client:flavor configuration value)
#
#
# The binary is downloaded from:
#
- # https://dl.k8s.io/v[[ client.kubectl.version ]]/kubernetes-client-linux-amd64.tar.gz
+ # https://dl.k8s.io/v[[ client.kubectl.version ]]/kubernetes-client-[[ client.flavor ]].tar.gz
#
#
# Defaults to the SHA 256 hash for the Linux distribution of version 1.6.7
@@ -81,7 +94,7 @@
# the binary:
#
# ```
- # shasum -a 256 /path/to/kubernetes-client-linux-amd64.tar.gz
+ # shasum -a 256 /path/to/kubernetes-client-[[ client.flavor ]].tar.gz
# ```
#
# download_hash: sha256=54947ef84181e89f9dbacedd54717cbed5cc7f9c36cb37bc8afc9097648e2c91