mirror of https://github.com/databricks/cli.git
Fix force flag not working for bundle destroy (#434)
## Changes `--force` flag did not exist for `bundle destroy`. This PR adds that in. ## Tests manually tested. Now adding the `--force` flag hijacks the deploy lock on the target directory.
This commit is contained in:
parent
bb32067a80
commit
4a03265dc2
|
@ -15,7 +15,7 @@ var deployCmd = &cobra.Command{
|
||||||
b := bundle.Get(cmd.Context())
|
b := bundle.Get(cmd.Context())
|
||||||
|
|
||||||
// If `--force` is specified, force acquisition of the deployment lock.
|
// If `--force` is specified, force acquisition of the deployment lock.
|
||||||
b.Config.Bundle.Lock.Force = force
|
b.Config.Bundle.Lock.Force = forceDeploy
|
||||||
|
|
||||||
return bundle.Apply(cmd.Context(), b, bundle.Seq(
|
return bundle.Apply(cmd.Context(), b, bundle.Seq(
|
||||||
phases.Initialize(),
|
phases.Initialize(),
|
||||||
|
@ -25,9 +25,9 @@ var deployCmd = &cobra.Command{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var force bool
|
var forceDeploy bool
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
AddCommand(deployCmd)
|
AddCommand(deployCmd)
|
||||||
deployCmd.Flags().BoolVar(&force, "force", false, "Force acquisition of deployment lock.")
|
deployCmd.Flags().BoolVar(&forceDeploy, "force", false, "Force acquisition of deployment lock.")
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ var destroyCmd = &cobra.Command{
|
||||||
b := bundle.Get(ctx)
|
b := bundle.Get(ctx)
|
||||||
|
|
||||||
// If `--force` is specified, force acquisition of the deployment lock.
|
// If `--force` is specified, force acquisition of the deployment lock.
|
||||||
b.Config.Bundle.Lock.Force = force
|
b.Config.Bundle.Lock.Force = forceDestroy
|
||||||
|
|
||||||
// If `--auto-approve`` is specified, we skip confirmation checks
|
// If `--auto-approve`` is specified, we skip confirmation checks
|
||||||
b.AutoApprove = autoApprove
|
b.AutoApprove = autoApprove
|
||||||
|
@ -51,8 +51,10 @@ var destroyCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
var autoApprove bool
|
var autoApprove bool
|
||||||
|
var forceDestroy bool
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
AddCommand(destroyCmd)
|
AddCommand(destroyCmd)
|
||||||
destroyCmd.Flags().BoolVar(&autoApprove, "auto-approve", false, "Skip interactive approvals for deleting resources and files")
|
destroyCmd.Flags().BoolVar(&autoApprove, "auto-approve", false, "Skip interactive approvals for deleting resources and files")
|
||||||
|
destroyCmd.Flags().BoolVar(&forceDestroy, "force", false, "Force acquisition of deployment lock.")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue