vendor: update to latest versions of everything
This commit is contained in:
parent
4415aa5c2e
commit
467fe30a5e
276 changed files with 38996 additions and 14449 deletions
43
vendor/google.golang.org/appengine/internal/identity_vm.go
generated
vendored
43
vendor/google.golang.org/appengine/internal/identity_vm.go
generated
vendored
|
@ -7,8 +7,10 @@
|
|||
package internal
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
netcontext "golang.org/x/net/context"
|
||||
)
|
||||
|
@ -39,7 +41,21 @@ func RequestID(ctx netcontext.Context) string {
|
|||
}
|
||||
|
||||
func Datacenter(ctx netcontext.Context) string {
|
||||
return ctxHeaders(ctx).Get(hDatacenter)
|
||||
if dc := ctxHeaders(ctx).Get(hDatacenter); dc != "" {
|
||||
return dc
|
||||
}
|
||||
// If the header isn't set, read zone from the metadata service.
|
||||
// It has the format projects/[NUMERIC_PROJECT_ID]/zones/[ZONE]
|
||||
zone, err := getMetadata("instance/zone")
|
||||
if err != nil {
|
||||
log.Printf("Datacenter: %v", err)
|
||||
return ""
|
||||
}
|
||||
parts := strings.Split(string(zone), "/")
|
||||
if len(parts) == 0 {
|
||||
return ""
|
||||
}
|
||||
return parts[len(parts)-1]
|
||||
}
|
||||
|
||||
func ServerSoftware() string {
|
||||
|
@ -47,6 +63,9 @@ func ServerSoftware() string {
|
|||
if s := os.Getenv("SERVER_SOFTWARE"); s != "" {
|
||||
return s
|
||||
}
|
||||
if s := os.Getenv("GAE_ENV"); s != "" {
|
||||
return s
|
||||
}
|
||||
return "Google App Engine/1.x.x"
|
||||
}
|
||||
|
||||
|
@ -56,6 +75,9 @@ func ModuleName(_ netcontext.Context) string {
|
|||
if s := os.Getenv("GAE_MODULE_NAME"); s != "" {
|
||||
return s
|
||||
}
|
||||
if s := os.Getenv("GAE_SERVICE"); s != "" {
|
||||
return s
|
||||
}
|
||||
return string(mustGetMetadata("instance/attributes/gae_backend_name"))
|
||||
}
|
||||
|
||||
|
@ -63,6 +85,9 @@ func VersionID(_ netcontext.Context) string {
|
|||
if s1, s2 := os.Getenv("GAE_MODULE_VERSION"), os.Getenv("GAE_MINOR_VERSION"); s1 != "" && s2 != "" {
|
||||
return s1 + "." + s2
|
||||
}
|
||||
if s1, s2 := os.Getenv("GAE_VERSION"), os.Getenv("GAE_DEPLOYMENT_ID"); s1 != "" && s2 != "" {
|
||||
return s1 + "." + s2
|
||||
}
|
||||
return string(mustGetMetadata("instance/attributes/gae_backend_version")) + "." + string(mustGetMetadata("instance/attributes/gae_backend_minor_version"))
|
||||
}
|
||||
|
||||
|
@ -70,19 +95,27 @@ func InstanceID() string {
|
|||
if s := os.Getenv("GAE_MODULE_INSTANCE"); s != "" {
|
||||
return s
|
||||
}
|
||||
if s := os.Getenv("GAE_INSTANCE"); s != "" {
|
||||
return s
|
||||
}
|
||||
return string(mustGetMetadata("instance/attributes/gae_backend_instance"))
|
||||
}
|
||||
|
||||
func partitionlessAppID() string {
|
||||
// gae_project has everything except the partition prefix.
|
||||
appID := os.Getenv("GAE_LONG_APP_ID")
|
||||
if appID == "" {
|
||||
appID = string(mustGetMetadata("instance/attributes/gae_project"))
|
||||
if appID := os.Getenv("GAE_LONG_APP_ID"); appID != "" {
|
||||
return appID
|
||||
}
|
||||
return appID
|
||||
if project := os.Getenv("GOOGLE_CLOUD_PROJECT"); project != "" {
|
||||
return project
|
||||
}
|
||||
return string(mustGetMetadata("instance/attributes/gae_project"))
|
||||
}
|
||||
|
||||
func fullyQualifiedAppID(_ netcontext.Context) string {
|
||||
if s := os.Getenv("GAE_APPLICATION"); s != "" {
|
||||
return s
|
||||
}
|
||||
appID := partitionlessAppID()
|
||||
|
||||
part := os.Getenv("GAE_PARTITION")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue