Skip to content

Commit

Permalink
remove NewGCEGenerator() and NewEC2Generator()
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed Jul 15, 2015
1 parent dfd473b commit 301dbd5
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions spec/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ var timeout = 100 * time.Millisecond
// SuggestCloudGenerator returns suitable CloudGenerator
func SuggestCloudGenerator() *CloudGenerator {
if isEC2() {
return &CloudGenerator{NewEC2Generator()}
return &CloudGenerator{&EC2Generator{ec2BaseURL}}
}
if isGCE() {
return &CloudGenerator{NewGCEGenerator()}
return &CloudGenerator{&GCEGenerator{gceMetaURL}}
}

return nil
Expand Down Expand Up @@ -109,11 +109,6 @@ type EC2Generator struct {
baseURL *url.URL
}

// NewEC2Generator returns new instance of EC2Generator
func NewEC2Generator() *EC2Generator {
return &EC2Generator{ec2BaseURL}
}

// Generate collects metadata from cloud platform.
func (g *EC2Generator) Generate() (interface{}, error) {
client := http.Client{
Expand Down Expand Up @@ -169,11 +164,6 @@ type GCEGenerator struct {
metaURL *url.URL
}

// NewGCEGenerator returns new GCEGenerator
func NewGCEGenerator() *GCEGenerator {
return &GCEGenerator{gceMetaURL}
}

// Generate collects metadata from cloud platform.
func (g *GCEGenerator) Generate() (interface{}, error) {
bytes, err := requestGCEMeta()
Expand Down

0 comments on commit 301dbd5

Please sign in to comment.