Skip to content

Fix kubectl exec command: use -- separator and grep instead of Select-String#1

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-kubectl-exec-command
Draft

Fix kubectl exec command: use -- separator and grep instead of Select-String#1
Copilot wants to merge 2 commits intomainfrom
copilot/fix-kubectl-exec-command

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 17, 2026

Two bugs in the kubectl exec invocation caused runtime failures: a single - was used instead of -- to separate the pod name from the command (causing the container runtime to attempt executing - as a binary), and Select-String (PowerShell-only) was used in a Linux shell context.

Changes

  • README: Documents the correct kubectl exec syntax and cross-platform filtering:
# Broken
kubectl exec -n contentautomation <pod> - printenv | Select-String "DB|POSTGRES|JDBC|SPRING_DATASOURCE"

# Fixed
kubectl exec -n contentautomation <pod> -- printenv | grep -E "DB|POSTGRES|JDBC|SPRING_DATASOURCE"
  • Adds a quick-reference table mapping the incorrect forms to their correct equivalents

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix kubectl exec command deprecation issues Fix kubectl exec separator and cross-platform filter command Mar 17, 2026
Copilot AI requested a review from Thomas1782k March 17, 2026 17:12
Copilot AI changed the title Fix kubectl exec separator and cross-platform filter command Fix kubectl exec command: use -- separator and grep instead of Select-String Mar 27, 2026
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