From 26ededcbb8c71eea8db8a77fb6fe85abfe5fadd1 Mon Sep 17 00:00:00 2001 From: caliskanugur Date: Mon, 28 Oct 2024 15:02:26 -0400 Subject: [PATCH] Fix corral file wait and debugging option --- clients/corral/corral.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clients/corral/corral.go b/clients/corral/corral.go index 931ebae7..2b15989a 100644 --- a/clients/corral/corral.go +++ b/clients/corral/corral.go @@ -18,7 +18,7 @@ import ( ) const ( - debugFlag = "--trace" + debugFlag = "--debug" skipCleanupFlag = "--skip-cleanup" corralPrivateSSHKey = "corral_private_key" corralPublicSSHKey = "corral_public_key" @@ -152,11 +152,15 @@ func waitForCorralConfig(corralName string) error { corralOSPath := homeDir + "/.corral/corrals/" + corralName + "/corral.yaml" return wait.ExponentialBackoff(backoff, func() (finished bool, err error) { - _, err = os.Stat(corralOSPath) + fileStat, err := os.Stat(corralOSPath) if err != nil { return false, nil } + if fileStat == nil { + return false, nil + } + fileContents, err := os.ReadFile(corralOSPath) if err != nil { return false, nil