From 30141f9b6d32d76baab934fdf1b07f84afa199d3 Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Sun, 26 Nov 2023 11:09:44 +0900 Subject: [PATCH] Align master plugin restoration logic with message Signed-off-by: Kichan Kwon --- cmd/thin_entrypoint/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/thin_entrypoint/main.go b/cmd/thin_entrypoint/main.go index 555a1c4fe..e9130784b 100644 --- a/cmd/thin_entrypoint/main.go +++ b/cmd/thin_entrypoint/main.go @@ -590,12 +590,13 @@ func main() { fmt.Printf("Master plugin @ %q has been deleted. Allowing 45 seconds for its restoration...\n", masterConfigFilePath) time.Sleep(10 * time.Second) - for range time.Tick(1 * time.Second) { + for i := 0; i < 35; i++ { _, err = os.Stat(masterConfigFilePath) if !os.IsNotExist(err) { fmt.Printf("Master plugin @ %q was restored. Regenerating given configuration.\n", masterConfigFilePath) break } + time.Sleep(1 * time.Second) } } masterConfigFilePath, err = opt.createMultusConfig()