diff --git a/pkg/cloudcfg/cloudcfg.go b/pkg/cloudcfg/cloudcfg.go index 41e93b4f3cb..cafaaddaa4d 100644 --- a/pkg/cloudcfg/cloudcfg.go +++ b/pkg/cloudcfg/cloudcfg.go @@ -88,45 +88,6 @@ func Update(name string, client client.ClientInterface, updatePeriod time.Durati return nil } -/*// RequestWithBody is a helper method that creates an HTTP request with the specified url, method -// and a body read from 'configFile' -func requestWithBody(configFile, url, method string) (*http.Request, error) { - if len(configFile) == 0 { - return nil, fmt.Errorf("empty config file.") - } - data, err := ioutil.ReadFile(configFile) - if err != nil { - return nil, err - } - return requestWithBodyData(data, url, method) -} - -// RequestWithBodyData is a helper method that creates an HTTP request with the specified url, method -// and body data -func requestWithBodyData(data []byte, url, method string) (*http.Request, error) { - request, err := http.NewRequest(method, url, bytes.NewBuffer(data)) - request.ContentLength = int64(len(data)) - return request, err -} - -// Execute a request, adds authentication (if auth != nil), and HTTPS cert ignoring. -func doRequest(request *http.Request, auth *client.AuthInfo) ([]byte, error) { - if auth != nil { - request.SetBasicAuth(auth.User, auth.Password) - } - tr := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - } - client := &http.Client{Transport: tr} - response, err := client.Do(request) - if err != nil { - return []byte{}, err - } - defer response.Body.Close() - body, err := ioutil.ReadAll(response.Body) - return body, err -}*/ - // StopController stops a controller named 'name' by setting replicas to zero func StopController(name string, client client.ClientInterface) error { controller, err := client.GetReplicationController(name) diff --git a/pkg/cloudcfg/cloudcfg_test.go b/pkg/cloudcfg/cloudcfg_test.go index eb3cbcc50ef..b016fccca3d 100644 --- a/pkg/cloudcfg/cloudcfg_test.go +++ b/pkg/cloudcfg/cloudcfg_test.go @@ -258,17 +258,6 @@ func TestCloudCfgDeleteControllerWithReplicas(t *testing.T) { } } -/* -func TestRequestWithBodyNoSuchFile(t *testing.T) { - request, err := requestWithBody("non/existent/file.json", "http://www.google.com", "GET") - if request != nil { - t.Error("Unexpected non-nil result") - } - if err == nil { - t.Error("Unexpected non-error") - } -}*/ - func TestLoadAuthInfo(t *testing.T) { testAuthInfo := &client.AuthInfo{ User: "TestUser", diff --git a/pkg/cloudcfg/resource_printer.go b/pkg/cloudcfg/resource_printer.go index 02c13791a99..fe914efe942 100644 --- a/pkg/cloudcfg/resource_printer.go +++ b/pkg/cloudcfg/resource_printer.go @@ -162,8 +162,6 @@ func (h *HumanReadablePrinter) printStatus(status *api.Status, w io.Writer) erro return err } -// TODO replace this with something that returns a concrete printer object, rather than -// having the secondary switch below. func (h *HumanReadablePrinter) Print(data []byte, output io.Writer) error { var mapObj map[string]interface{} if err := json.Unmarshal([]byte(data), &mapObj); err != nil {