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

feat: add --yes flag to uninstall command #733

Merged
merged 2 commits into from
Nov 2, 2023
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
13 changes: 8 additions & 5 deletions cli/cmd/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ var uninstallCmd = &cobra.Command{
os.Exit(1)
}

fmt.Printf("About to uninstall Odigos from namespace %s\n", ns)
confirmed, err := confirm.Ask("Are you sure?")
if err != nil || !confirmed {
fmt.Println("Aborting uninstall")
return
if !cmd.Flag("yes").Changed {
fmt.Printf("About to uninstall Odigos from namespace %s\n", ns)
confirmed, err := confirm.Ask("Are you sure?")
if err != nil || !confirmed {
fmt.Println("Aborting uninstall")
return
}
}

createKubeResourceWithLogging(ctx, "Uninstalling Odigos Deployments",
Expand Down Expand Up @@ -366,4 +368,5 @@ func uninstallNamespace(ctx context.Context, cmd *cobra.Command, client *kube.Cl

func init() {
rootCmd.AddCommand(uninstallCmd)
uninstallCmd.Flags().Bool("yes", false, "Skip the confirmation prompt")
}
3 changes: 3 additions & 0 deletions docs/cli/odigos_uninstall.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Note: This command is not revertable and will delete any configuration you have
# Uninstall Odigos open-source or cloud from the cluster in your kubeconfig active context.
odigos uninstall

# Uninstall Odigos without confirmation
odigos uninstall --yes

# Uninstall Odigos cloud from a specific cluster
odigos uninstall --kubeconfig <path-to-kubeconfig>

Expand Down