diff --git a/pkg/cmd/destroy/destroy.go b/pkg/cmd/destroy/destroy.go index dfecce7e..812821ed 100644 --- a/pkg/cmd/destroy/destroy.go +++ b/pkg/cmd/destroy/destroy.go @@ -37,7 +37,6 @@ import ( "kusionstack.io/kusion/pkg/engine/state" "kusionstack.io/kusion/pkg/log" "kusionstack.io/kusion/pkg/util/pretty" - "kusionstack.io/kusion/pkg/util/signals" ) var ( @@ -150,9 +149,6 @@ func (o *DeleteOptions) Validate(cmd *cobra.Command, args []string) error { // Run executes the `delete` command. func (o *DeleteOptions) Run() error { - // listen for interrupts or the SIGTERM signal - signals.HandleInterrupt() - // only destroy resources we managed storage := o.StorageBackend.StateStorage(o.RefProject.Name, o.RefStack.Name, o.RefWorkspace.Name) priorState, err := storage.Get() diff --git a/pkg/util/signals/signal.go b/pkg/util/signals/signal.go deleted file mode 100644 index 0973e352..00000000 --- a/pkg/util/signals/signal.go +++ /dev/null @@ -1,22 +0,0 @@ -package signals - -import ( - "os" - "os/signal" - "syscall" - - "kusionstack.io/kusion/pkg/log" -) - -var shutdownSignals = []os.Signal{os.Interrupt, syscall.SIGTERM} - -// listen for interrupts or the SIGTERM signal and -// executing clean job -func HandleInterrupt() { - stopCh := make(chan os.Signal, 1) - signal.Notify(stopCh, shutdownSignals...) - go func() { - <-stopCh - log.Info("Received termination, signaling shutdown, executing clean job") - }() -}