Skip to content

Commit

Permalink
feat(windows): store binaries in c:\kubernetes\bin
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Oct 18, 2020
1 parent 2443757 commit bd94157
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 8 deletions.
1 change: 1 addition & 0 deletions kubernetes/client/archive/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- retry: {{ d.retry_option|json }}
- enforce_toplevel: false
- trim_output: true
- force: true
{%- if grains.os != 'Windows' %}
- user: {{ d.identity.rootuser }}
- group: {{ d.identity.rootgroup }}
Expand Down
21 changes: 21 additions & 0 deletions kubernetes/devtools/archive/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
- recurse:
- user
- group
{%- elif tool in ('devspace', 'k3s', 'kind', 'linkerd2', 'minikube', 'skaffold', 'stern') %}
cmd.run:
- name: mv {{d.dir.base~d.div~'bin'~d.div}}{{ tool }} {{d.dir.base~d.div~'bin'~d.div}}{{ tool }}.exe
- onlyif: test -f {{d.dir.base~d.div~'bin'~d.div}}{{ tool }}
{%- endif %}
{%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %}
{%- for cmd in d.devtools['pkg'][tool]['commands']|unique %}
Expand All @@ -67,4 +72,20 @@
{% endif %}
{% endif %}
{%- endfor %}
{%- if grains.os == 'Windows' %}{# tidyup c:\kubernetes\bin #}
{{ formula }}-devtools-archive-install-windows-tidyup:
cmd.run:
- names:
- mv {{d.dir.base~d.div~'bin'~d.div}}istio-{{ d.devtools.pkg.istio.version }}{{d.div~'bin'~d.div}}istioctl {{d.dir.base~d.div~'bin'~d.div}}
- mv {{d.dir.base~d.div~'bin'~d.div}}octant_{{ d.devtools.pkg.octant.version }}_Windows-64Bit{{ d.div }}octant {{d.dir.base~d.div~'bin'~d.div}}
file.absent:
- names:
- {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}/doc
- {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}/README.md
- {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}/LICENSE
- {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}istio-{{ d.devtools.pkg.istio.version }}
- {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}octant_{{ d.devtools.pkg.octant.version }}_Windows-64Bit
{%- endif %}
{%- endif %}
6 changes: 5 additions & 1 deletion kubernetes/devtools/binary/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@
- mode: '0755'
- user: {{ d.identity.rootuser }}
- group: {{ d.identity.rootgroup }}
{%- endif %}
{%- elif tool in ('devspace', 'k3s', 'kind', 'linkerd2', 'minikube', 'skaffold', 'stern') %}
cmd.run:
- name: mv {{d.dir.base~d.div~'bin'~d.div}}{{ tool }} {{d.dir.base~d.div~'bin'~d.div}}{{ tool }}.exe
- onlyif: test -f {{d.dir.base~d.div~'bin'~d.div}}{{ tool }}
{%- endif %}
{%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %}
{%- for cmd in p[tool]['commands']|unique %}
{{ formula }}-devtools-binary-{{ tool }}-install-symlink-{{ cmd }}:
Expand Down
8 changes: 6 additions & 2 deletions kubernetes/k3s/binary/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
- source_hash: {{ d.k3s.pkg.binary.source_hash }}
- makedirs: True
- retry: {{ d.retry_option|json }}
{%- if grains.os != 'Windows' %}
{%- if grains.os != 'Windows' %}
- mode: 755
- user: {{ d.identity.rootuser }}
- group: {{ d.identity.rootgroup }}
{%- endif %}
{%- else %}
cmd.run:
- name: mv {{ d.k3s.pkg.path }}k3s {{ d.k3s.pkg.path }}k3s.exe
- onlyif: test -f {{ d.k3s.pkg.path }}k3s
{%- endif %}
{%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %}
{%- for cmd in d.k3s.pkg['commands']|unique %}
Expand Down
8 changes: 5 additions & 3 deletions kubernetes/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@
{%- endif %}

{# PATH #}
{%- do p.update({ 'path': '%sk8s-%s-%s-%s%s'|format(path, c, i, p['version'], d.div) }) %}
{%- if i in ('audit2rbac', 'cue', 'dive', 'istio', 'kubens', 'kubectx', 'octant', 'krew') %}
{%- do p.update({ 'path': '%s%sbin%s'|format(p.path, d.div, d.div) }) %}
{%- if grains.os != 'Windows' %}
{%- do p.update({ 'path': '%sk8s-%s-%s-%s%s'|format(path, c, i, p['version'], d.div) }) %}
{%- if i in ('audit2rbac', 'cue', 'dive', 'istio', 'kubens', 'kubectx', 'octant', 'krew') %}
{%- do p.update({ 'path': '%s%sbin%s'|format(p.path, d.div, d.div) }) %}
{%- endif %}
{%- endif %}

{%- if url %}
Expand Down
1 change: 1 addition & 0 deletions kubernetes/node/archive/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- retry: {{ d.retry_option|json }}
- enforce_toplevel: false
- trim_output: true
- force: true
{%- if grains.os != 'Windows' %}
- user: {{ d.identity.rootuser }}
- group: {{ d.identity.rootgroup }}
Expand Down
8 changes: 6 additions & 2 deletions kubernetes/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Windows:
suffix: ''
use_upstream: package
binary:
options: '--strip-components=2' # windows
source_hash: '6ec32a8a62b69363a524c4f8db765ff4bd16ea7e5b0eb04aa5a667f8653eda18c357a97513d9e12f0ba1612516acb150deffb6e3608633c62b97a15b6efa7cc0'
server: {}
node:
Expand All @@ -106,7 +107,9 @@ Windows:
pkg:
use_upstream: archive
archive:
options: '--strip-components=2' # windows
source_hash: '587651158c9999e64e06186ef2e65fe14d46ffdae28c5d8ee6261193bfe4967717f997ebe13857fa1893bbf492e1cc1f816bce86a94c6df9b7a0264848391397' # noqa 204

sigs:
pkg:
kind:
Expand Down Expand Up @@ -135,7 +138,7 @@ Windows:
suffix: zip
archive:
source_hash: '07f276d1f1396a634881598fd8cd6532ed25325048081defccdb54512b6037f4'
options: ''
options: '' # zipfile
k3s:
use_upstream: false # no windows binary
kubectx:
Expand All @@ -154,7 +157,7 @@ Windows:
suffix: zip
arch: '' # noarch
archive:
options: ''
options: '' # zipfile
cue:
suffix: zip
archive:
Expand Down Expand Up @@ -229,6 +232,7 @@ MacOS:
suffix: zip
archive:
source_hash: 'f3ac074585bd3afbf529da7e37e5e8844150504fdb420f0cc930f31e766ce24a'
options: '' # zipfile
linkerd2:
binary:
source_hash: '1adc9c53fe968383020b6c4047d42452754e05bc90d1a65f2261d729c6fab4df'
Expand Down
5 changes: 5 additions & 0 deletions kubernetes/sigs/archive/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
- recurse:
- user
- group
{%- elif tool in ('kind',) %}
cmd.run:
- name: mv {{d.dir.base~d.div~'bin'~d.div}}{{ tool }} {{d.dir.base~d.div~'bin'~d.div}}{{ tool }}.exe
- onlyif: test -f {{d.dir.base~d.div~'bin'~d.div}}{{ tool }}
{%- endif %}
{%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %}
{%- for cmd in p['commands']|unique %}
Expand Down
5 changes: 5 additions & 0 deletions kubernetes/sigs/binary/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
- pkg: {{ formula }}-sigs-binary-deps-install
- user: {{ d.identity.rootuser }}
- group: {{ d.identity.rootgroup }}
{%- elif tool in ('kind',) %}
cmd.run:
- name: mv {{d.dir.base~d.div~'bin'~d.div}}{{ tool }} {{d.dir.base~d.div~'bin'~d.div}}{{ tool }}.exe
- onlyif: test -f {{d.dir.base~d.div~'bin'~d.div}}{{ tool }}
{%- endif %}
{%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %}
{%- for cmd in p['commands']|unique %}
Expand Down

0 comments on commit bd94157

Please sign in to comment.