Skip to content

Commit

Permalink
Add krew auto completion (kubernetes-sigs#8171)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengtianbao authored and sakuraiyuta committed Apr 16, 2022
1 parent 41afe40 commit 3fd9056
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roles/kubernetes-apps/krew/tasks/krew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@
environment:
KREW_ROOT: "{{ krew_root_dir }}"
KREW_DEFAULT_INDEX_URI: "{{ krew_default_index_uri | default('') }}"

- name: Krew | Get krew completion
command: "{{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }} completion bash"
changed_when: False
register: krew_completion
check_mode: False

- name: Krew | Install krew completion
copy:
dest: /etc/bash_completion.d/krew.sh
content: "{{ krew_completion.stdout }}"
become: True
1 change: 1 addition & 0 deletions roles/reset/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@
- /etc/bash_completion.d/crictl
- /etc/bash_completion.d/nerdctl
- /etc/bash_completion.d/krew
- /etc/bash_completion.d/krew.sh
- "{{ krew_root_dir | default('/usr/local/krew') }}"
- /etc/modules-load.d/kube_proxy-ipvs.conf
- /etc/modules-load.d/kubespray-br_netfilter.conf
Expand Down

0 comments on commit 3fd9056

Please sign in to comment.