Skip to content

Commit

Permalink
fakemetadata: remove unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <[email protected]>
  • Loading branch information
zchee committed Feb 15, 2023
1 parent f76def7 commit b0e9d10
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions fakemetadata/fakemetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
// Package fakemetadata provides the fake GCE compute metadata server for testing.
package fakemetadata

import (
"net/url"
"path"
"strings"
)

// List of metadata server variables.
//
// Those are exported and don't use constant types so can be replaced.
Expand All @@ -27,20 +21,8 @@ var (
//
// So this environment variable is helpful to replace the server that the cloud.google.com/go/compute/metadata package accesses during testing.
MetadataHostEnv = "GCE_METADATA_HOST"

// RootURL is the documented metadata server Host.
RootURL = "metadata.google.internal"

// SubPath is the documented metadata sub-path.
SubPath = path.Join("computeMetadata", "v1")
)

var rootURL = &url.URL{
Scheme: "http",
Host: RootURL,
Path: SubPath,
}

// List of request http header constants.
//
// See also: https://cloud.google.com/compute/docs/metadata/overview
Expand All @@ -55,17 +37,3 @@ const (
// LegacyRequestHeader is the legacy (but still supported) required http header for access to the metadata server.
LegacyRequestHeader = "X-Google-Metadata-Request: True"
)

// QueryReplacer replaces string pairs for not supported in a request path to the metadata server.
//
// See details: https://cloud.google.com/compute/docs/metadata/overview#limitations
var QueryReplacer = strings.NewReplacer(
"%21", "!",
"%24", "$",
"%27", "'",
"%28", "(",
"%29", ")",
"%2A", "*",
"%2C", ",",
"%40", "@",
)

0 comments on commit b0e9d10

Please sign in to comment.