mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Fix buffered signal channel go vet error
This commit is contained in:
parent
333eb833e5
commit
322bc82777
@ -205,7 +205,7 @@ func main() {
|
|||||||
// process and all its children, we ignore it here, while our children ssh connections
|
// process and all its children, we ignore it here, while our children ssh connections
|
||||||
// are stopped. This allows us to gather artifacts and print out test state before
|
// are stopped. This allows us to gather artifacts and print out test state before
|
||||||
// being killed.
|
// being killed.
|
||||||
c := make(chan os.Signal)
|
c := make(chan os.Signal, 2)
|
||||||
signal.Notify(c, os.Interrupt)
|
signal.Notify(c, os.Interrupt)
|
||||||
go func() {
|
go func() {
|
||||||
<-c
|
<-c
|
||||||
|
@ -216,7 +216,7 @@ func main(cmd *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if delayShutdown > 0 {
|
if delayShutdown > 0 {
|
||||||
termCh := make(chan os.Signal)
|
termCh := make(chan os.Signal, 1)
|
||||||
signal.Notify(termCh, syscall.SIGTERM)
|
signal.Notify(termCh, syscall.SIGTERM)
|
||||||
go func() {
|
go func() {
|
||||||
<-termCh
|
<-termCh
|
||||||
|
@ -36,7 +36,7 @@ var CmdPause = &cobra.Command{
|
|||||||
|
|
||||||
func pause(cmd *cobra.Command, args []string) {
|
func pause(cmd *cobra.Command, args []string) {
|
||||||
fmt.Println("Paused")
|
fmt.Println("Paused")
|
||||||
sigCh := make(chan os.Signal)
|
sigCh := make(chan os.Signal, 1)
|
||||||
done := make(chan int, 1)
|
done := make(chan int, 1)
|
||||||
signal.Notify(sigCh, syscall.SIGINT)
|
signal.Notify(sigCh, syscall.SIGINT)
|
||||||
signal.Notify(sigCh, syscall.SIGTERM)
|
signal.Notify(sigCh, syscall.SIGTERM)
|
||||||
|
Loading…
Reference in New Issue
Block a user