Skip to content
Open
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
5 changes: 5 additions & 0 deletions internal/cmd/skupper/system/nonkube/system_uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,16 @@ func (cmd *CmdSystemUninstall) Run() error {
return err
}

if len(entries) == 0 {
Copy link
Member

@nluaces nluaces Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message is not printed when there are no namespaces to remove:

nluaces:skupper$ skupper system install 
Pulled system-controller image: quay.io/skupper/system-controller:v2-dev
Platform podman is now configured for Skupper
nluaces:skupper$ skupper system uninstall --force
System-controller has been removed
Platform podman infrastructure for Skupper is now uninstalled

Because in that directory there is an entry called controller.lock, I think it is better to check that there are no directories instead of entries, or just to remove that message.

fmt.Println("No namespaces found to remove")
}

for _, entry := range entries {
if entry.IsDir() {
runtimeDir := "namespaces/" + entry.Name() + "/runtime/"
_, err := os.ReadDir(path.Join(api.GetHostDataHome(), runtimeDir))
if err == nil {
fmt.Printf("Removing active site namespace \"%s\"\n", entry.Name())
err := cmd.TearDown(entry.Name())
if err != nil {
return fmt.Errorf("failed to remove site \"%s\": %s", entry.Name(), err)
Expand Down
12 changes: 11 additions & 1 deletion internal/nonkube/bootstrap/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,17 @@ func CheckActiveSites() (bool, error) {
_, err := os.ReadDir(path.Join(api.GetHostDataHome(), runtimeDir))
if err == nil {
activeSites = true
fmt.Printf("site %s active\n", entry.Name())
siteName := ""
runtimeSiteStatePath := path.Join(api.GetHostNamespaceHome(entry.Name()), string(api.RuntimeSiteStatePath))
siteStateLoader := &common.FileSystemSiteStateLoader{Path: runtimeSiteStatePath}
if siteState, loadErr := siteStateLoader.Load(); loadErr == nil && siteState != nil && siteState.Site != nil {
siteName = siteState.Site.Name
}
if siteName != "" {
fmt.Printf("The %s site is active (namespace %s)\n", siteName, entry.Name())
} else {
fmt.Printf("The %s site is active\n", entry.Name())
}
}

}
Expand Down