mirror of
https://github.com/fluxcd/flux2.git
synced 2025-11-03 11:21:57 +08:00
Add silent option to uninstall
This commit is contained in:
2
.github/workflows/e2e.yaml
vendored
2
.github/workflows/e2e.yaml
vendored
@ -41,7 +41,7 @@ jobs:
|
||||
run: |
|
||||
./bin/tk check
|
||||
./bin/tk install --version=master --namespace=test --verbose
|
||||
./bin/tk uninstall --namespace=test --crds
|
||||
./bin/tk uninstall --namespace=test --crds --silent
|
||||
./bin/tk install --manifests ./manifests/install/
|
||||
./bin/tk create source podinfo --git-url https://github.com/stefanprodan/podinfo-deploy --git-semver=">=0.0.1-rc.1 <0.1.0"
|
||||
- name: Debug failure
|
||||
|
||||
@ -21,6 +21,7 @@ cluster role bindings and CRDs`,
|
||||
var (
|
||||
uninstallCRDs bool
|
||||
uninstallDryRun bool
|
||||
uninstallSilent bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -28,6 +29,8 @@ func init() {
|
||||
"removes all CRDs previously installed")
|
||||
uninstallCmd.Flags().BoolVarP(&uninstallDryRun, "dry-run", "", false,
|
||||
"only print the object that would be deleted")
|
||||
uninstallCmd.Flags().BoolVarP(&uninstallSilent, "silent", "", false,
|
||||
"delete components without asking for confirmation")
|
||||
|
||||
rootCmd.AddCommand(uninstallCmd)
|
||||
}
|
||||
@ -39,7 +42,7 @@ func uninstallCmdRun(cmd *cobra.Command, args []string) error {
|
||||
dryRun := ""
|
||||
if uninstallDryRun {
|
||||
dryRun = "--dry-run=client"
|
||||
} else {
|
||||
} else if !uninstallSilent {
|
||||
prompt := promptui.Prompt{
|
||||
Label: fmt.Sprintf("Are you sure you want to delete the %s namespace", namespace),
|
||||
IsConfirm: true,
|
||||
|
||||
Reference in New Issue
Block a user