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

Issue open-horizon#4179 - Bug: agent-uninstall.sh doesn't doesn't jus… #4188

Merged
merged 2 commits into from
Dec 11, 2024
Merged
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
9 changes: 3 additions & 6 deletions agent-install/agent-uninstall.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ SKIP_DELETE_AGENT_NAMESPACE=false
USE_DELETE_FORCE=false
DELETE_TIMEOUT=10 # Default delete timeout

function now() {
echo `date '+%Y-%m-%d %H:%M:%S'`
}

# Exit handling
function quit(){
case $1 in
Expand Down Expand Up @@ -216,7 +212,7 @@ function get_agent_pod_id() {
fi

if [ "$AGENT_POD_READY" == "true" ]; then
POD_ID=$($KUBECTL get pod -n ${AGENT_NAMESPACE} 2> /dev/null | grep "agent-" | cut -d " " -f1 2> /dev/null)
POD_ID=$($KUBECTL get pod -n ${AGENT_NAMESPACE} -l app=agent,type!=auto-upgrade-cronjob 2> /dev/null | grep "agent-" | cut -d " " -f1 2> /dev/null)
if [ -n "${POD_ID}" ]; then
log_info "get pod: ${POD_ID}"
else
Expand Down Expand Up @@ -288,8 +284,9 @@ function unregister() {
log_debug "unregister() end"
}

# escape: ;, $, &, |, (, )
function getEscapedExchangeUserAuth() {
local escaped_auth=$( echo "${HZN_EXCHANGE_USER_AUTH}" | sed 's/;/\\;/g;s/\$/\\$/g;s/\&/\\&/g;s/|/\\|/g' )
local escaped_auth=$( echo "${HZN_EXCHANGE_USER_AUTH}" | sed 's/;/\\;/g;s/\$/\\$/g;s/\&/\\&/g;s/|/\\|/g;s/(/\\(/g;s/)/\\)/g' )
echo "${escaped_auth}"
}

Expand Down