Skip to content

Commit cf9f321

Browse files
dholtclaude
andcommitted
fix: address Copilot review feedback on kubectl cross-platform
- Set executable mode on fetched kubectl binary (fetch doesn't preserve) - Add changed_when: false to kubectl version command for idempotency - Add SHA256 checksum verification for cross-platform kubectl download - Respect proxy_env for get_url in proxy environments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Douglas Holt <dholt@nvidia.com>
1 parent 97051de commit cf9f321

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

playbooks/k8s-cluster.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,19 @@
209209
run_once: true
210210
when: local_uname.stdout == remote_uname.stdout
211211

212+
- name: ensure fetched kubectl is executable
213+
file:
214+
path: "{{ artifacts_dir }}/kubectl"
215+
mode: '0755'
216+
delegate_to: localhost
217+
run_once: true
218+
when: local_uname.stdout == remote_uname.stdout
219+
212220
- name: get kubectl version for cross-platform download
213221
command: /usr/local/bin/kubectl version --client -o json
214222
register: kubectl_ver_json
215223
run_once: true
224+
changed_when: false
216225
when: local_uname.stdout != remote_uname.stdout
217226

218227
- name: download kubectl for ansible host platform
@@ -225,6 +234,8 @@
225234
dest: "{{ artifacts_dir }}/kubectl"
226235
mode: '0755'
227236
force: yes
237+
checksum: "sha256:https://dl.k8s.io/release/{{ kubectl_ver }}/bin/{{ kubectl_os }}/{{ kubectl_arch }}/kubectl.sha256"
238+
environment: "{{ proxy_env if proxy_env is defined else {} }}"
228239
delegate_to: localhost
229240
run_once: true
230241
when: local_uname.stdout != remote_uname.stdout

0 commit comments

Comments
 (0)