Skip to content

Commit

Permalink
Fix corral file wait and update the debugging option
Browse files Browse the repository at this point in the history
  • Loading branch information
caliskanugur committed Nov 25, 2024
1 parent fd60336 commit 0ea9560
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions clients/corral/corral.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

const (
debugFlag = "--trace"
debugFlag = "--debug"
skipCleanupFlag = "--skip-cleanup"
corralPrivateSSHKey = "corral_private_key"
corralPublicSSHKey = "corral_public_key"
Expand Down Expand Up @@ -152,16 +152,24 @@ 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
}

if fileContents == nil {
return false, nil
}

if len(string(fileContents)) <= 0 {
return false, nil
}
Expand Down

0 comments on commit 0ea9560

Please sign in to comment.