-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
When I execute a kubectl command from a runbook, with spaces in its arguments, it fails with errors.
This comes from the the /opt/hoop/bin/kubectl shell wrapper, which calls the kubectl binary with $@ instead of "$@"
Steps to Reproduce
- connect to a connection configured to start a shell on the hoop-agent
- execute
kubectl get pods -n namespace --selector "app.kubernetes.io/name=podname" --field-selector status.phase=Running --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'
Note that there's a space the in the template value.
Expected Behavior
The kubectl command should return with a pod name.
Actual Behavior
The kubectl command fails with the error
error: name cannot be provided when a selector is specified
Version
1.47.2
Browser(s)
Other
Operating System
Ubuntu 24.04
Screenshots
No response
Additional Context
In
hoop/rootfs/opt/hoop/bin/kubectl
Lines 5 to 8 in 42768c9
| if [[ -z "$HEADER_AUTHORIZATION" ]]; then | |
| /usr/local/bin/kubectl $@ | |
| exit $? | |
| fi |
- The line
/usr/local/bin/kubectl $@ - should rather be:
/usr/local/bin/kubectl "$@"
Likewise,
hoop/rootfs/opt/hoop/bin/kubectl
Line 11 in 42768c9
| /usr/local/bin/kubectl --server="$REMOTE_URL" --insecure-skip-tls-verify=$INSECURE --token="$HEADER_AUTHORIZATION" $@ |
should be
/usr/local/bin/kubectl --server="$REMOTE_URL" --insecure-skip-tls-verify=$INSECURE --token="$HEADER_AUTHORIZATION" "$@"
Relevant Log Output
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working