Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[k8s] Handle @ in context name #4147

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sky/utils/command_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,9 @@ def get_remote_home_dir() -> str:
# default delimiter for options and arguments.
# rsync_helper.sh will parse the namespace_context by reverting the
# encoding and pass it to kubectl exec.
encoded_namespace_context = namespace_context.replace(
':', '%3A').replace('/', '%2F').replace('+', '%2B')
encoded_namespace_context = (namespace_context.replace(
'@', '%40').replace(':', '%3A').replace('/',
'%2F').replace('+', '%2B'))
self._rsync(
source,
target,
Expand Down
2 changes: 1 addition & 1 deletion sky/utils/kubernetes/rsync_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ shift
echo "pod: $pod" >&2
encoded_namespace_context=$1
# Revert the encoded namespace+context to the original string.
namespace_context=$(echo "$encoded_namespace_context" | sed 's|%3A|:|g' | sed 's|%2B|+|g' | sed 's|%2F|/|g')
namespace_context=$(echo "$encoded_namespace_context" | sed 's|%40|@|g' | sed 's|%3A|:|g' | sed 's|%2B|+|g' | sed 's|%2F|/|g')
echo "namespace_context: $namespace_context" >&2
namespace=$(echo $namespace_context | cut -d+ -f1)
echo "namespace: $namespace" >&2
Expand Down
Loading