Skip to content

Commit

Permalink
uninstall: fix no confirmation when istiod cannot be connected (istio…
Browse files Browse the repository at this point in the history
…#47617)

* fix no confirmation when istiod cannot be connected

* revise
  • Loading branch information
hanxiaop authored Oct 31, 2023
1 parent 968a6f9 commit 7aa04ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions operator/cmd/mesh/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ func preCheckWarnings(cmd *cobra.Command, kubeClient kube.CLIClient, uiArgs *uni
rev string, resourcesList []*unstructured.UnstructuredList, objectsList object.K8sObjects, l *clog.ConsoleLogger, dryRun bool,
) {
pids, err := proxyinfo.GetIDsFromProxyInfo(kubeClient, istioNamespace)
if err != nil {
l.LogAndError(err.Error())
}
needConfirmation, message := false, ""
if uiArgs.purge {
needConfirmation = true
Expand All @@ -238,6 +235,10 @@ func preCheckWarnings(cmd *cobra.Command, kubeClient kube.CLIClient, uiArgs *uni
}
message += "If you proceed with the uninstall, these proxies will become detached from any control plane" +
" and will not function correctly.\n"
} else if rev != "" && err != nil {
needConfirmation = true
message += fmt.Sprintf("Unable to find any proxies pointing to the %s control plane. "+
"This may be because the control plane cannot be connected or there is no %s control plane.\n", rev, rev)
}
if gwList != "" {
needConfirmation = true
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/47617.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: release-notes/v2
kind: bug-fix
area: installation
releaseNotes:
- |
**Fixed** an issue where sometimes `uninstall` was performed without confirmation when istiod was not available to be connected.

0 comments on commit 7aa04ee

Please sign in to comment.