Skip to content

Commit

Permalink
fix: try to sleep before inject the ebpf
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirdavid1 committed Dec 5, 2024
1 parent a53f818 commit e31d001
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion k8sutils/pkg/predicate/containers_ready.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package predicate

import (
"fmt"
"time"

k8scontainer "github.com/odigos-io/odigos/k8sutils/pkg/container"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/event"
k8scontainer "github.com/odigos-io/odigos/k8sutils/pkg/container"
)

// AllContainersReadyPredicate is a predicate that checks if all containers in a pod are ready or becoming ready.
Expand All @@ -26,6 +29,8 @@ func (p *AllContainersReadyPredicate) Create(e event.CreateEvent) bool {
allContainersReady := k8scontainer.AllContainersReady(pod)
// If all containers are not ready, return false.
// Otherwise, return true
fmt.Println("Sleeping for 15 seconds before injecting the ebpf probes")
time.Sleep(15 * time.Second)
return allContainersReady
}

Expand Down

0 comments on commit e31d001

Please sign in to comment.