Browse Source

Add krew auto completion (#8171)

pull/8179/head
zhengtianbao 3 years ago
committed by GitHub
parent
commit
46c536d261
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions
  1. 12
      roles/kubernetes-apps/krew/tasks/krew.yml
  2. 1
      roles/reset/tasks/main.yml

12
roles/kubernetes-apps/krew/tasks/krew.yml

@ -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
roles/reset/tasks/main.yml

@ -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

Loading…
Cancel
Save