From c7db8fe42e6b3524160690517f5ea0ddc775f6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandra=20Chy=C5=82a?= Date: Wed, 4 Dec 2024 15:36:36 +0100 Subject: [PATCH] Issue open-horizon#4181 - Bug: Output log for agent uninstall needs better clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aleksandra Chyła --- agent-install/agent-uninstall.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/agent-install/agent-uninstall.sh b/agent-install/agent-uninstall.sh index 0df85f4a5..f265322c9 100644 --- a/agent-install/agent-uninstall.sh +++ b/agent-install/agent-uninstall.sh @@ -379,23 +379,23 @@ function deleteAgentResources() { fi log_info "Deleting configmap..." - $KUBECTL delete configmap $CONFIGMAP_NAME -n $AGENT_NAMESPACE - $KUBECTL delete configmap ${CONFIGMAP_NAME}-backup -n $AGENT_NAMESPACE + $KUBECTL delete configmap $CONFIGMAP_NAME -n $AGENT_NAMESPACE --ignore-not-found + $KUBECTL delete configmap ${CONFIGMAP_NAME}-backup -n $AGENT_NAMESPACE --ignore-not-found log_info "Deleting secret..." - $KUBECTL delete secret $SECRET_NAME -n $AGENT_NAMESPACE - $KUBECTL delete secret $IMAGE_REGISTRY_SECRET_NAME -n $AGENT_NAMESPACE - $KUBECTL delete secret $IMAGE_PULL_SECRET_NAME -n $AGENT_NAMESPACE - $KUBECTL delete secret ${SECRET_NAME}-backup -n $AGENT_NAMESPACE + $KUBECTL delete secret $SECRET_NAME -n $AGENT_NAMESPACE --ignore-not-found + $KUBECTL delete secret $IMAGE_REGISTRY_SECRET_NAME -n $AGENT_NAMESPACE --ignore-not-found + $KUBECTL delete secret $IMAGE_PULL_SECRET_NAME -n $AGENT_NAMESPACE --ignore-not-found + $KUBECTL delete secret ${SECRET_NAME}-backup -n $AGENT_NAMESPACE --ignore-not-found log_info "Deleting persistent volume..." - $KUBECTL delete pvc $PVC_NAME -n $AGENT_NAMESPACE + $KUBECTL delete pvc $PVC_NAME -n $AGENT_NAMESPACE --ignore-not-found log_info "Deleting clusterrolebinding..." - $KUBECTL delete clusterrolebinding ${AGENT_NAMESPACE}-${CLUSTER_ROLE_BINDING_NAME} + $KUBECTL delete clusterrolebinding ${AGENT_NAMESPACE}-${CLUSTER_ROLE_BINDING_NAME} --ignore-not-found log_info "Deleting serviceaccount..." - $KUBECTL delete serviceaccount $SERVICE_ACCOUNT_NAME -n $AGENT_NAMESPACE + $KUBECTL delete serviceaccount $SERVICE_ACCOUNT_NAME -n $AGENT_NAMESPACE --ignore-not-found if [[ "$SKIP_DELETE_AGENT_NAMESPACE" != "true" ]]; then log_info "Checking deployment and statefulset under namespace $AGENT_NAMESPACE" @@ -412,7 +412,7 @@ function deleteAgentResources() { fi log_info "Deleting cert file from /etc/default/cert ..." - rm /etc/default/cert/agent-install.crt + rm -f /etc/default/cert/agent-install.crt set -e log_debug "deleteAgentResources() end"