(ctx context.Context, param params.UpdateSystemInfoParams)
| 972 | } |
| 973 | |
| 974 | func (r *Runner) UpdateSystemInfo(ctx context.Context, param params.UpdateSystemInfoParams) error { |
| 975 | instanceName := auth.InstanceName(ctx) |
| 976 | if instanceName == "" { |
| 977 | slog.ErrorContext(ctx, "missing instance name") |
| 978 | return runnerErrors.ErrUnauthorized |
| 979 | } |
| 980 | |
| 981 | if param.OSName == "" && param.OSVersion == "" && param.AgentID == nil { |
| 982 | // Nothing to update |
| 983 | return nil |
| 984 | } |
| 985 | |
| 986 | updateParams := params.UpdateInstanceParams{ |
| 987 | OSName: param.OSName, |
| 988 | OSVersion: param.OSVersion, |
| 989 | } |
| 990 | |
| 991 | if param.AgentID != nil { |
| 992 | updateParams.AgentID = *param.AgentID |
| 993 | } |
| 994 | |
| 995 | if _, err := r.store.UpdateInstance(r.ctx, instanceName, updateParams); err != nil { |
| 996 | return fmt.Errorf("error updating runner system info: %w", err) |
| 997 | } |
| 998 | |
| 999 | return nil |
| 1000 | } |
| 1001 | |
| 1002 | func (r *Runner) getPoolManagerFromInstance(ctx context.Context, instance params.Instance) (common.PoolManager, error) { |
| 1003 | pool, err := r.store.GetPoolByID(ctx, instance.PoolID) |
no test coverage detected