From 00be5e70eb34bc7636a242d07d8a0c49e7449ad4 Mon Sep 17 00:00:00 2001 From: Paolo Chila Date: Thu, 20 Jun 2024 17:54:07 +0200 Subject: [PATCH] Remove me! - Added a time.Sleep to enroll command before restart --- internal/pkg/agent/cmd/enroll_cmd.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/pkg/agent/cmd/enroll_cmd.go b/internal/pkg/agent/cmd/enroll_cmd.go index 4dd721cdef1..940b1da3725 100644 --- a/internal/pkg/agent/cmd/enroll_cmd.go +++ b/internal/pkg/agent/cmd/enroll_cmd.go @@ -290,6 +290,8 @@ func (c *enrollCmd) Execute(ctx context.Context, streams *cli.IOStreams) error { } }() + time.Sleep(5 * time.Second) + if c.agentProc == nil && !c.options.SkipDaemonRestart { if err = c.daemonReloadWithBackoff(ctx); err != nil { c.log.Errorf("Elastic Agent might not be running; unable to trigger restart: %v", err)