diff --git a/cmd/run.go b/cmd/run.go index 3dcf3c3..5784d45 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -156,12 +156,18 @@ loop: } else { log.Warnln("[Reload] Stopped old control plane") } + // Inject bpf objects into the new control plane life-cycle. newC.InjectBpf(obj) - c.Close() + + // Prepare new context. + oldC := c c = newC conf = newConf reloading = true + + // Ready to close. + oldC.Close() default: break loop }