Created
June 23, 2020 17:07
-
-
Save ET-Chan/5fe1bd0090ffbfd82ac979fc0bdeb6a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$KRSYNC_STARTED" ]; then | |
export KRSYNC_STARTED=true | |
exec rsync --blocking-io --rsh "$0" $@ | |
fi | |
# Running as --rsh | |
namespace='' | |
pod=$1 | |
shift | |
# If use uses pod@namespace rsync passes as: {us} -l pod namespace ... | |
if [ "X$pod" = "X-l" ]; then | |
pod=$1 | |
shift | |
namespace="-n $1" | |
shift | |
fi | |
exec kubectl $namespace exec -i $pod -- "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment