From 3ad7b9e2c1bfdacae7911669b34d03bed0742c00 Mon Sep 17 00:00:00 2001 From: mattiasavelin Date: Fri, 7 Jun 2024 13:10:17 +0200 Subject: [PATCH] Go => 1.22 and lastest cloud.google.com/go/compute version --- go.mod | 4 ++-- go.sum | 1 + pkg/metadata/metadata.go | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index ef99acf..998291d 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/dentech-floss/metadata -go 1.17 +go 1.22 -require cloud.google.com/go/compute v1.6.1 +require cloud.google.com/go/compute v1.27.0 diff --git a/go.sum b/go.sum index 8597211..57d3bfd 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,7 @@ cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6m cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1 h1:2sMmt8prCn7DPaG4Pmh0N3Inmc8cT8ae5k1M6VJ9Wqc= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.27.0/go.mod h1:LG5HwRmWFKM2C5XxHRiNzkLLXW48WwvyVC0mfWsYPOM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= diff --git a/pkg/metadata/metadata.go b/pkg/metadata/metadata.go index 37345fc..c78ca5a 100644 --- a/pkg/metadata/metadata.go +++ b/pkg/metadata/metadata.go @@ -32,7 +32,7 @@ func NewMetadata() *Metadata { } } -// Returns the current instance's numeric project ID. +// NumericProjectID - Returns the current instance's numeric project ID. func (m *Metadata) NumericProjectID() (string, error) { if m.OnGCP { return metadata.NumericProjectID() @@ -40,7 +40,7 @@ func (m *Metadata) NumericProjectID() (string, error) { return "", nil } -// Returns the current VM's numeric instance ID. +// InstanceID - Returns the current VM's numeric instance ID. func (m *Metadata) InstanceID() (string, error) { if m.OnGCP { return metadata.InstanceID() @@ -48,7 +48,7 @@ func (m *Metadata) InstanceID() (string, error) { return "", nil } -// Returns the Cloud Run geographical region. +// Region - Returns the Cloud Run geographical region. func (m *Metadata) Region() (string, error) { if m.OnGCP { return metadata.Get("instance/region") @@ -56,7 +56,7 @@ func (m *Metadata) Region() (string, error) { return "", nil } -// Returns an OIDC token to call another services that can validate an identity token. +// IdentityToken - Returns an OIDC token to call another services that can validate an identity token. // On Cloud Run, the provided "audience" shall be the URL of the service you want to invoke. // https://cloud.google.com/run/docs/securing/service-identity#identity_tokens func (m *Metadata) IdentityToken(audience string) (string, error) { @@ -66,7 +66,7 @@ func (m *Metadata) IdentityToken(audience string) (string, error) { return "", nil } -// Returns an access token required to call GCP API's with. +// AccessToken - Returns an access token required to call GCP API's with. // The provided "scopes" shall be a list of the OAuth scopes requested. // https://cloud.google.com/run/docs/securing/service-identity#access_tokens func (m *Metadata) AccessToken(scopes []string) (string, error) {