Skip to content

Conversation

Copy link

Copilot AI commented Dec 31, 2025

The az_connect_k8s.sh script prompted users for password during SCP operations and required manual SSH host key acceptance, breaking automation workflows.

Changes

  • Auto-extract credentials: Parse admin_user and admin_password from fixtures.tfvars using grep/sed
  • Silent SCP: Use sshpass with SSH options -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
  • Remove hardcoded user: Replace mhadmin with dynamically retrieved value from fixtures
  • Fallback installation: Auto-install sshpass if missing

Before/After

# Before: prompts for password and host key
scp mhadmin@$master_pip:/home/mhadmin/.kube/config ~/.kube/config

# After: fully automated
sshpass -p "$admin_password" scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
    ${admin_user}@${master_pip}:/home/${admin_user}/.kube/config ~/.kube/config

The extraction logic handles varied spacing and special characters in passwords. Error handling validates file existence and successful parsing before proceeding.

Original prompt

Work on TODO: scp prompts for password - retrieve and use password from fixtures.tfvars silently (from 03-Azure/01-03-Infrastructure/03_Hybrid_Azure_Arc_Kubernetes/lab/scripts/az_connect_k8s.sh)

Created from VS Code via the GitHub Pull Request extension.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 31, 2025 15:18
…z_connect_k8s.sh

Co-authored-by: skiddder <56867233+skiddder@users.noreply.github.com>
Co-authored-by: skiddder <56867233+skiddder@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to retrieve password from fixtures for SCP prompts Implement silent password retrieval from fixtures.tfvars for SCP in az_connect_k8s.sh Dec 31, 2025
Copilot AI requested a review from skiddder December 31, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants