Skip to content

Add orchcli clean command for environment cleanup and reset #18

Description

@mohit-nagaraj

Description

Implement a comprehensive clean command to help developers reset their KubeOrchestra environment. This command
should handle Docker resources, cloned repositories, and various caches with appropriate safety measures.

Motivation

Developers often need to:

  • Start fresh after configuration issues
  • Clean up disk space from Docker resources
  • Remove test data and reset databases
  • Switch between different project setups
  • Troubleshoot by starting from a clean state

Implementation Tasks

Core Functionality:

  • Create cmd/clean.go with clean command
  • Register command in cmd/root.go
  • Implement confirmation prompts (unless --force used)
  • Show what will be deleted before confirmation
  • Display space that will be reclaimed

Docker Cleanup:

  • Stop and remove KubeOrchestra containers
  • Remove KubeOrchestra Docker volumes (MongoDB data)
  • Remove KubeOrchestra Docker networks
  • Clean up dangling images related to KubeOrchestra
  • Option to prune all unused Docker resources

Repository Cleanup:

  • Remove cloned UI repository (with --repos flag)
  • Remove cloned Core repository (with --repos flag)
  • Check for uncommitted changes before deletion
  • Backup option for uncommitted work

Cache and Build Cleanup:

  • Clear Go build cache (with --cache flag)
  • Clear npm/node_modules in UI repo (with --cache flag)
  • Clear Docker build cache (with --cache flag)
  • Remove .air.toml temporary files

Configuration Cleanup:

  • Remove OrchCLI config files (~/.orchcli/*)
  • Reset project configuration
  • Option to keep configuration (--keep-config)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions