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 cluster-only uninstall option and resource deletion handling #634

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ATGardner
Copy link
Collaborator

Introduce a new flag --clusterOnly to the uninstall command, allowing
direct uninstallation from the cluster without interacting with the git
repository.

Signed-off-by: Noam Gal noam.gal@octopus.com

@ATGardner ATGardner self-assigned this Jan 31, 2025
@ATGardner ATGardner linked an issue Jan 31, 2025 that may be closed by this pull request
@ATGardner
Copy link
Collaborator Author

/ci

Introduce a new flag `--clusterOnly` to the uninstall command, allowing
direct uninstallation from the cluster without interacting with the git
repository.

Signed-off-by: Noam Gal <noam.gal@octopus.com>
Signed-off-by: Noam Gal <noam.gal@octopus.com>
Ensure that required flags are validated only when not
fixed tests

Signed-off-by: Noam Gal <noam.gal@octopus.com>
@ATGardner ATGardner force-pushed the uninstall-cluster-only branch from a3a0ccd to e18ec61 Compare February 2, 2025 07:58
@ATGardner
Copy link
Collaborator Author

/ci

@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2025

Codecov Report

Attention: Patch coverage is 37.50000% with 50 lines in your changes missing coverage. Please review.

Project coverage is 40.49%. Comparing base (27048d7) to head (3fcfb4f).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cmd/commands/repo.go 46.87% 32 Missing and 2 partials ⚠️
pkg/kube/kube.go 0.00% 8 Missing ⚠️
pkg/kube/mocks/kube.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #634      +/-   ##
==========================================
- Coverage   40.66%   40.49%   -0.18%     
==========================================
  Files          41       41              
  Lines        6730     6786      +56     
==========================================
+ Hits         2737     2748      +11     
- Misses       3879     3922      +43     
- Partials      114      116       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Noam Gal <noam.gal@octopus.com>

var revision string
if r != nil && repofs != nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

return condition

RunE: func(cmd *cobra.Command, _ []string) error {
kubeContextName, err := cmd.Flags().GetString("context")
if err != nil {
return fmt.Errorf("failed to get kube context name: %w", err)
}

if !clusterOnly {
if cloneOpts.Repo == "" || cloneOpts.Auth.Password == "" {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

check if cobra can handle this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

argocd-autopilot repo uninstall removes autopilot repo
2 participants