Skip to content

Commit

Permalink
contrib: fast return if runner-group server is not found (#143)
Browse files Browse the repository at this point in the history
If runner-group server is not found, let's return error instead of
retrying. Maybe server is still running, but data loss happens in ETCD
side. It's impossible to get result in this case. Fast-return is that
only we can do.

Signed-off-by: Wei Fu <[email protected]>
  • Loading branch information
fuweid authored Dec 18, 2024
1 parent 66af6c9 commit ee26b10
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contrib/internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ func DeployRunnerGroup(ctx context.Context,
// Using 1 min as timeout is to ensure we can get result in time.
data, err := kr.RGResult(ctx, 1*time.Minute)
if err != nil {
// FIXME(weifu): If the pod is not found, we should fast
// return. However, it's hard to maintain error string
// match. We should use specific commandline error code
// or use package instead of binary call.
if strings.Contains(err.Error(), `pods "runnergroup-server" not found`) {
return nil, err
}

klog.ErrorS(err, "failed to fetch runner group's result")
continue
}
Expand Down

0 comments on commit ee26b10

Please sign in to comment.