mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Add timeout for rkt requests.
This commit is contained in:
@@ -79,7 +79,9 @@ func (c *Config) buildGlobalOptions() []string {
|
||||
// that the fields in the provided config will override the
|
||||
// result that get from the rkt api service.
|
||||
func (r *Runtime) getConfig(cfg *Config) (*Config, error) {
|
||||
resp, err := r.apisvc.GetInfo(context.Background(), &rktapi.GetInfoRequest{})
|
||||
ctx, cancel := context.WithTimeout(context.Background(), r.requestTimeout)
|
||||
defer cancel()
|
||||
resp, err := r.apisvc.GetInfo(ctx, &rktapi.GetInfoRequest{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user