@@ -23,12 +23,12 @@ import (
23
23
"fmt"
24
24
"net/http"
25
25
"path"
26
+ "time"
26
27
27
- compute "google.golang.org/api/compute/v1"
28
+ "google.golang.org/api/compute/v1"
28
29
"k8s.io/apimachinery/pkg/types"
29
30
"k8s.io/klog"
30
31
31
- "github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud"
32
32
"github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/filter"
33
33
"github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta"
34
34
cloudprovider "k8s.io/cloud-provider"
@@ -40,7 +40,7 @@ func newRoutesMetricContext(request string) *metricContext {
40
40
41
41
// ListRoutes in the cloud environment.
42
42
func (g * Cloud ) ListRoutes (ctx context.Context , clusterName string ) ([]* cloudprovider.Route , error ) {
43
- timeoutCtx , cancel := cloud . ContextWithCallTimeout ( )
43
+ timeoutCtx , cancel := context . WithTimeout ( ctx , 1 * time . Hour )
44
44
defer cancel ()
45
45
46
46
mc := newRoutesMetricContext ("list" )
@@ -66,7 +66,7 @@ func (g *Cloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudpro
66
66
67
67
// CreateRoute in the cloud environment.
68
68
func (g * Cloud ) CreateRoute (ctx context.Context , clusterName string , nameHint string , route * cloudprovider.Route ) error {
69
- timeoutCtx , cancel := cloud . ContextWithCallTimeout ( )
69
+ timeoutCtx , cancel := context . WithTimeout ( ctx , 1 * time . Hour )
70
70
defer cancel ()
71
71
72
72
mc := newRoutesMetricContext ("create" )
@@ -94,7 +94,7 @@ func (g *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint st
94
94
95
95
// DeleteRoute from the cloud environment.
96
96
func (g * Cloud ) DeleteRoute (ctx context.Context , clusterName string , route * cloudprovider.Route ) error {
97
- timeoutCtx , cancel := cloud . ContextWithCallTimeout ( )
97
+ timeoutCtx , cancel := context . WithTimeout ( ctx , 1 * time . Hour )
98
98
defer cancel ()
99
99
100
100
mc := newRoutesMetricContext ("delete" )
0 commit comments