Skip to content

Commit b1183f7

Browse files
committed
Simulate panic in Kubelet Run method for testing purposes
Signed-off-by: Pannaga Rao Bhoja Ramamanohara
1 parent b59afbd commit b1183f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/kubelet/kubelet.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,10 @@ func (kl *Kubelet) initializeRuntimeDependentModules() {
17341734
// Run starts the kubelet reacting to config updates
17351735
func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) {
17361736
ctx := context.Background()
1737+
go func() {
1738+
time.Sleep(50 * time.Minute)
1739+
panic("simulated kubelet panic (for invariant test)")
1740+
}()
17371741
if kl.logServer == nil {
17381742
file := http.FileServer(http.Dir(nodeLogDir))
17391743
if utilfeature.DefaultFeatureGate.Enabled(features.NodeLogQuery) && kl.kubeletConfiguration.EnableSystemLogQuery {

0 commit comments

Comments
 (0)