Skip to content

Commit 2e77959

Browse files
committed
fix golang-ci lint of meatada get with context
Signed-off-by: Paco Xu <[email protected]>
1 parent 4e6c9c9 commit 2e77959

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

utils/cloudinfo/gce/gce.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package gce
1616

1717
import (
18+
"context"
1819
"os"
1920
"strings"
2021

@@ -48,7 +49,7 @@ func (provider) IsActiveProvider() bool {
4849
}
4950

5051
func (provider) GetInstanceType() info.InstanceType {
51-
machineType, err := metadata.Get("instance/machine-type")
52+
machineType, err := metadata.GetWithContext(context.TODO(),"instance/machine-type")
5253
if err != nil {
5354
return info.UnknownInstance
5455
}
@@ -58,7 +59,7 @@ func (provider) GetInstanceType() info.InstanceType {
5859
}
5960

6061
func (provider) GetInstanceID() info.InstanceID {
61-
instanceID, err := metadata.Get("instance/id")
62+
instanceID, err := metadata.GetWithContext(context.TODO(), "instance/id")
6263
if err != nil {
6364
return info.UnknownInstance
6465
}

0 commit comments

Comments
 (0)