mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-17 16:08:12 +00:00
🔨 Rename WaitForFinish
method to WaitForTermination
This commit is contained in:
parent
11a2f93e34
commit
33f23ea849
@ -238,7 +238,7 @@ func pcap() {
|
|||||||
|
|
||||||
ctxC, cancel := context.WithCancel(context.Background())
|
ctxC, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
utils.WaitForFinish(ctxC, cancel)
|
utils.WaitForTermination(ctxC, cancel)
|
||||||
|
|
||||||
err = stopAndRemoveContainers(ctx, cli, respFront, respHub, respWorker)
|
err = stopAndRemoveContainers(ctx, cli, respFront, respHub, respWorker)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -64,7 +64,7 @@ func runProxy() {
|
|||||||
|
|
||||||
okToOpen(url)
|
okToOpen(url)
|
||||||
|
|
||||||
utils.WaitForFinish(ctx, cancel)
|
utils.WaitForTermination(ctx, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
func okToOpen(url string) {
|
func okToOpen(url string) {
|
||||||
|
@ -100,7 +100,7 @@ func tap() {
|
|||||||
go goUtils.HandleExcWrapper(watchFrontPod, ctx, kubernetesProvider, cancel)
|
go goUtils.HandleExcWrapper(watchFrontPod, ctx, kubernetesProvider, cancel)
|
||||||
|
|
||||||
// block until exit signal or error
|
// block until exit signal or error
|
||||||
utils.WaitForFinish(ctx, cancel)
|
utils.WaitForTermination(ctx, cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
func finishTapExecution(kubernetesProvider *kubernetes.Provider) {
|
func finishTapExecution(kubernetesProvider *kubernetes.Provider) {
|
||||||
|
@ -80,7 +80,7 @@ func (connector *Connector) PostWorkerPodToHub(pod *v1.Pod) {
|
|||||||
ok = true
|
ok = true
|
||||||
log.Debug().Interface("worker-pod", pod).Msg("Reported worker pod to Hub:")
|
log.Debug().Interface("worker-pod", pod).Msg("Reported worker pod to Hub:")
|
||||||
}
|
}
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ func (connector *Connector) PostTargettedPodsToHub(pods []core.Pod) {
|
|||||||
ok = true
|
ok = true
|
||||||
log.Debug().Int("pod-count", len(pods)).Msg("Reported targetted pods to Hub:")
|
log.Debug().Int("pod-count", len(pods)).Msg("Reported targetted pods to Hub:")
|
||||||
}
|
}
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ func cleanUpNonRestrictedMode(ctx context.Context, cancel context.CancelFunc, ku
|
|||||||
func waitUntilNamespaceDeleted(ctx context.Context, cancel context.CancelFunc, kubernetesProvider *kubernetes.Provider, kubesharkResourcesNamespace string) {
|
func waitUntilNamespaceDeleted(ctx context.Context, cancel context.CancelFunc, kubernetesProvider *kubernetes.Provider, kubesharkResourcesNamespace string) {
|
||||||
// Call cancel if a terminating signal was received. Allows user to skip the wait.
|
// Call cancel if a terminating signal was received. Allows user to skip the wait.
|
||||||
go func() {
|
go func() {
|
||||||
utils.WaitForFinish(ctx, cancel)
|
utils.WaitForTermination(ctx, cancel)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if err := kubernetesProvider.WaitUtilNamespaceDeleted(ctx, kubesharkResourcesNamespace); err != nil {
|
if err := kubernetesProvider.WaitUtilNamespaceDeleted(ctx, kubesharkResourcesNamespace); err != nil {
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func WaitForFinish(ctx context.Context, cancel context.CancelFunc) {
|
func WaitForTermination(ctx context.Context, cancel context.CancelFunc) {
|
||||||
log.Debug().Msg("Waiting to finish...")
|
log.Debug().Msg("Waiting to finish...")
|
||||||
sigChan := make(chan os.Signal, 1)
|
sigChan := make(chan os.Signal, 1)
|
||||||
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
|
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
|
||||||
|
Loading…
Reference in New Issue
Block a user