Skip to content

Commit

Permalink
Force stop after second signal
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksontj committed Feb 4, 2019
1 parent d50de15 commit 3920be4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/katalog-sync-sidecar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,18 @@ WAITLOOP:
}
}

go func() {
<-sigs
cancel()
}()

// Send deregister request
for {
select {
case <-ctx.Done():
return
default:
}
logrus.Infof("deregister attempt")
_, err := client.Deregister(ctx, &katalogsync.DeregisterQuery{Namespace: opts.Namespace, PodName: opts.PodName, ContainerName: opts.ContainerName})
if err == nil {
Expand Down

0 comments on commit 3920be4

Please sign in to comment.