From 471c2a7d1f4652dec927ad4e83c65e693e7da276 Mon Sep 17 00:00:00 2001 From: Andy Goldstein Date: Tue, 29 Sep 2015 17:09:45 -0400 Subject: [PATCH] Fix google cloudmonitoring import path --- Godeps/Godeps.json | 8 +-- .../v2beta2/cloudmonitoring-api.json | 0 .../v2beta2/cloudmonitoring-gen.go | 60 ++++++------------- plugin/pkg/admission/initialresources/gcm.go | 2 +- 4 files changed, 23 insertions(+), 47 deletions(-) rename Godeps/_workspace/src/{github.com/google/google-api-go-client => google.golang.org/api}/cloudmonitoring/v2beta2/cloudmonitoring-api.json (100%) rename Godeps/_workspace/src/{github.com/google/google-api-go-client => google.golang.org/api}/cloudmonitoring/v2beta2/cloudmonitoring-gen.go (98%) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index a8e5f859efe..f05231444dc 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -354,10 +354,6 @@ "ImportPath": "github.com/google/gofuzz", "Rev": "bbcb9da2d746f8bdbd6a936686a0a6067ada0ec5" }, - { - "ImportPath": "github.com/google/google-api-go-client/cloudmonitoring/v2beta2", - "Rev": "8cbf97d5e925c857511aedf459affeed490e6861" - }, { "ImportPath": "github.com/gorilla/context", "Rev": "215affda49addc4c8ef7e2534915df2c8c35c6cd" @@ -600,6 +596,10 @@ "ImportPath": "golang.org/x/tools/imports", "Rev": "4f50f44d7a3206e9e28b984e023efce2a4a75369" }, + { + "ImportPath": "google.golang.org/api/cloudmonitoring/v2beta2", + "Rev": "0c2979aeaa5b573e60d3ddffe5ce8dca8df309bd" + }, { "ImportPath": "google.golang.org/api/compute/v1", "Rev": "0c2979aeaa5b573e60d3ddffe5ce8dca8df309bd" diff --git a/Godeps/_workspace/src/github.com/google/google-api-go-client/cloudmonitoring/v2beta2/cloudmonitoring-api.json b/Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json similarity index 100% rename from Godeps/_workspace/src/github.com/google/google-api-go-client/cloudmonitoring/v2beta2/cloudmonitoring-api.json rename to Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json diff --git a/Godeps/_workspace/src/github.com/google/google-api-go-client/cloudmonitoring/v2beta2/cloudmonitoring-gen.go b/Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-gen.go similarity index 98% rename from Godeps/_workspace/src/github.com/google/google-api-go-client/cloudmonitoring/v2beta2/cloudmonitoring-gen.go rename to Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-gen.go index bec61252873..64c84ddc8fb 100644 --- a/Godeps/_workspace/src/github.com/google/google-api-go-client/cloudmonitoring/v2beta2/cloudmonitoring-gen.go +++ b/Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-gen.go @@ -439,7 +439,7 @@ func (c *MetricDescriptorsCreateCall) Fields(s ...googleapi.Field) *MetricDescri return c } -func (c *MetricDescriptorsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *MetricDescriptorsCreateCall) Do() (*MetricDescriptor, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.metricdescriptor) if err != nil { @@ -447,7 +447,7 @@ func (c *MetricDescriptorsCreateCall) doRequest(alt string) (*http.Response, err } ctype := "application/json" params := make(url.Values) - params.Set("alt", alt) + params.Set("alt", "json") if v, ok := c.opt_["fields"]; ok { params.Set("fields", fmt.Sprintf("%v", v)) } @@ -459,11 +459,7 @@ func (c *MetricDescriptorsCreateCall) doRequest(alt string) (*http.Response, err }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - return c.s.client.Do(req) -} - -func (c *MetricDescriptorsCreateCall) Do() (*MetricDescriptor, error) { - res, err := c.doRequest("json") + res, err := c.s.client.Do(req) if err != nil { return nil, err } @@ -531,10 +527,10 @@ func (c *MetricDescriptorsDeleteCall) Fields(s ...googleapi.Field) *MetricDescri return c } -func (c *MetricDescriptorsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *MetricDescriptorsDeleteCall) Do() (*DeleteMetricDescriptorResponse, error) { var body io.Reader = nil params := make(url.Values) - params.Set("alt", alt) + params.Set("alt", "json") if v, ok := c.opt_["fields"]; ok { params.Set("fields", fmt.Sprintf("%v", v)) } @@ -546,11 +542,7 @@ func (c *MetricDescriptorsDeleteCall) doRequest(alt string) (*http.Response, err "metric": c.metric, }) req.Header.Set("User-Agent", c.s.userAgent()) - return c.s.client.Do(req) -} - -func (c *MetricDescriptorsDeleteCall) Do() (*DeleteMetricDescriptorResponse, error) { - res, err := c.doRequest("json") + res, err := c.s.client.Do(req) if err != nil { return nil, err } @@ -654,10 +646,10 @@ func (c *MetricDescriptorsListCall) Fields(s ...googleapi.Field) *MetricDescript return c } -func (c *MetricDescriptorsListCall) doRequest(alt string) (*http.Response, error) { +func (c *MetricDescriptorsListCall) Do() (*ListMetricDescriptorsResponse, error) { var body io.Reader = nil params := make(url.Values) - params.Set("alt", alt) + params.Set("alt", "json") if v, ok := c.opt_["count"]; ok { params.Set("count", fmt.Sprintf("%v", v)) } @@ -677,11 +669,7 @@ func (c *MetricDescriptorsListCall) doRequest(alt string) (*http.Response, error "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - return c.s.client.Do(req) -} - -func (c *MetricDescriptorsListCall) Do() (*ListMetricDescriptorsResponse, error) { - res, err := c.doRequest("json") + res, err := c.s.client.Do(req) if err != nil { return nil, err } @@ -863,10 +851,10 @@ func (c *TimeseriesListCall) Fields(s ...googleapi.Field) *TimeseriesListCall { return c } -func (c *TimeseriesListCall) doRequest(alt string) (*http.Response, error) { +func (c *TimeseriesListCall) Do() (*ListTimeseriesResponse, error) { var body io.Reader = nil params := make(url.Values) - params.Set("alt", alt) + params.Set("alt", "json") params.Set("youngest", fmt.Sprintf("%v", c.youngest)) if v, ok := c.opt_["aggregator"]; ok { params.Set("aggregator", fmt.Sprintf("%v", v)) @@ -900,11 +888,7 @@ func (c *TimeseriesListCall) doRequest(alt string) (*http.Response, error) { "metric": c.metric, }) req.Header.Set("User-Agent", c.s.userAgent()) - return c.s.client.Do(req) -} - -func (c *TimeseriesListCall) Do() (*ListTimeseriesResponse, error) { - res, err := c.doRequest("json") + res, err := c.s.client.Do(req) if err != nil { return nil, err } @@ -1048,7 +1032,7 @@ func (c *TimeseriesWriteCall) Fields(s ...googleapi.Field) *TimeseriesWriteCall return c } -func (c *TimeseriesWriteCall) doRequest(alt string) (*http.Response, error) { +func (c *TimeseriesWriteCall) Do() (*WriteTimeseriesResponse, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.writetimeseriesrequest) if err != nil { @@ -1056,7 +1040,7 @@ func (c *TimeseriesWriteCall) doRequest(alt string) (*http.Response, error) { } ctype := "application/json" params := make(url.Values) - params.Set("alt", alt) + params.Set("alt", "json") if v, ok := c.opt_["fields"]; ok { params.Set("fields", fmt.Sprintf("%v", v)) } @@ -1068,11 +1052,7 @@ func (c *TimeseriesWriteCall) doRequest(alt string) (*http.Response, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - return c.s.client.Do(req) -} - -func (c *TimeseriesWriteCall) Do() (*WriteTimeseriesResponse, error) { - res, err := c.doRequest("json") + res, err := c.s.client.Do(req) if err != nil { return nil, err } @@ -1236,10 +1216,10 @@ func (c *TimeseriesDescriptorsListCall) Fields(s ...googleapi.Field) *Timeseries return c } -func (c *TimeseriesDescriptorsListCall) doRequest(alt string) (*http.Response, error) { +func (c *TimeseriesDescriptorsListCall) Do() (*ListTimeseriesDescriptorsResponse, error) { var body io.Reader = nil params := make(url.Values) - params.Set("alt", alt) + params.Set("alt", "json") params.Set("youngest", fmt.Sprintf("%v", c.youngest)) if v, ok := c.opt_["aggregator"]; ok { params.Set("aggregator", fmt.Sprintf("%v", v)) @@ -1273,11 +1253,7 @@ func (c *TimeseriesDescriptorsListCall) doRequest(alt string) (*http.Response, e "metric": c.metric, }) req.Header.Set("User-Agent", c.s.userAgent()) - return c.s.client.Do(req) -} - -func (c *TimeseriesDescriptorsListCall) Do() (*ListTimeseriesDescriptorsResponse, error) { - res, err := c.doRequest("json") + res, err := c.s.client.Do(req) if err != nil { return nil, err } diff --git a/plugin/pkg/admission/initialresources/gcm.go b/plugin/pkg/admission/initialresources/gcm.go index 8bc20d09edc..be6fae93477 100644 --- a/plugin/pkg/admission/initialresources/gcm.go +++ b/plugin/pkg/admission/initialresources/gcm.go @@ -23,9 +23,9 @@ import ( "k8s.io/kubernetes/pkg/api" - gcm "github.com/google/google-api-go-client/cloudmonitoring/v2beta2" "golang.org/x/oauth2" "golang.org/x/oauth2/google" + gcm "google.golang.org/api/cloudmonitoring/v2beta2" gce "google.golang.org/cloud/compute/metadata" )