Skip to content

Commit

Permalink
fix: xargs: command line cannot be assembled, too long
Browse files Browse the repository at this point in the history
  • Loading branch information
major1201 committed Oct 29, 2024
1 parent 339d62e commit bd25915
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mexec-exec
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ main() {
parse_arguments "$@"

if [[ -z "${local_file}" ]]; then
kubectl get pod "${kgp_args[@]}" -o name | awk -F/ '{print $2}' | xargs -P "${parallel}" -I{} bash -c "kubectl exec ${keti_args[*]@Q} {} -- ${cmd[*]@Q} |& sed s/^/{}\ /g"
kubectl get pod "${kgp_args[@]}" -o name | awk -F/ '{print $2}' | xargs -S10240 -P "${parallel}" -I{} bash -c "kubectl exec ${keti_args[*]@Q} {} -- ${cmd[*]@Q} |& sed s/^/{}\ /g"
else
if [[ ! -f "${local_file}" ]]; then
errecho "Error: local file ${local_file} not found"
Expand Down

0 comments on commit bd25915

Please sign in to comment.