Skip to content

Commit ee26b10

Browse files
authored
contrib: fast return if runner-group server is not found (#143)
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 <weifu@microsoft.com>
1 parent 66af6c9 commit ee26b10

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contrib/internal/utils/utils.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,14 @@ func DeployRunnerGroup(ctx context.Context,
264264
// Using 1 min as timeout is to ensure we can get result in time.
265265
data, err := kr.RGResult(ctx, 1*time.Minute)
266266
if err != nil {
267+
// FIXME(weifu): If the pod is not found, we should fast
268+
// return. However, it's hard to maintain error string
269+
// match. We should use specific commandline error code
270+
// or use package instead of binary call.
271+
if strings.Contains(err.Error(), `pods "runnergroup-server" not found`) {
272+
return nil, err
273+
}
274+
267275
klog.ErrorS(err, "failed to fetch runner group's result")
268276
continue
269277
}

0 commit comments

Comments
 (0)