Skip to content

Commit

Permalink
fix: Ignore failed read of exit code. Fixes #11490 (#11496)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <[email protected]>
  • Loading branch information
alexec authored Aug 1, 2023
1 parent dbabcbd commit 61a4ac4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmd/argoexec/commands/emissary.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,11 @@ func NewEmissaryCommand() *cobra.Command {
for _, y := range x.Dependencies {
logger.Infof("waiting for dependency %q", y)
for {
data, err := os.ReadFile(filepath.Clean(varRunArgo + "/ctr/" + y + "/exitcode"))
if os.IsNotExist(err) {
time.Sleep(time.Second)
continue
}
data, _ := os.ReadFile(filepath.Clean(varRunArgo + "/ctr/" + y + "/exitcode"))
exitCode, err := strconv.Atoi(string(data))
if err != nil {
return fmt.Errorf("failed to read exit-code of dependency %q: %w", y, err)
time.Sleep(time.Second)
continue
}
if exitCode != 0 {
return fmt.Errorf("dependency %q exited with non-zero code: %d", y, exitCode)
Expand Down

0 comments on commit 61a4ac4

Please sign in to comment.