Skip to content

Commit

Permalink
Fix/uninstall log (#673)
Browse files Browse the repository at this point in the history
# Fixes issue:
- Issue: #658 
- Update the error message for uninstall of odigos if it is not
installed

<br>

# Changes made:
- Updated the code such that if no **Namepace** is found then print the
updated error message and exit
- Other changes:
- Previously the code continues ```defaultnamespace``` but the updated
code print the error and exit

<br>

### Files changed:
- **uninstall.go** (cli/cmd/uninstall.go)
  • Loading branch information
HeetVekariya authored Oct 24, 2023
1 parent e24d22d commit e3df2dd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cli/cmd/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"context"
"fmt"
"os"
"strings"
"time"

Expand Down Expand Up @@ -37,8 +38,12 @@ var uninstallCmd = &cobra.Command{
ctx := cmd.Context()

ns, err := resources.GetOdigosNamespace(client, ctx)
if err != nil {
ns = consts.DefaultNamespace
if resources.IsErrNoOdigosNamespaceFound(err) {
fmt.Println("\033[31mERROR\033[0m odigos is not currently installed in the cluster, so there is nothing to uninstall")
os.Exit(1)
} else if !resources.IsErrNoOdigosNamespaceFound(err) && err != nil{
fmt.Printf("\033[31mERROR\033[0m Failed to check if Odigos is already uninstalled: %s\n", err)
os.Exit(1)
}

fmt.Printf("About to uninstall Odigos from namespace %s\n", ns)
Expand Down

0 comments on commit e3df2dd

Please sign in to comment.