func (c *ClientWrapper) GetDefaultReplicationControllers() ([]k8sapi.ReplicationController, error) {
	if c.Client != nil {
		ctx := context.TODO()

		getURL := c.apiUrl + "/namespaces/default/replicationcontrollers"

		// Make request to Kubernetes API
		req, err := http.NewRequest("GET", getURL, nil)
		if err != nil {
			return nil, fmt.Errorf("failed to create request: GET %q : %v", getURL, err)
		}
		res, err := ctxhttp.Do(ctx, c.httpClient, req)
		if err != nil {
			return nil, fmt.Errorf("failed to make request: GET %q: %v", getURL, err)
		}

		body, err := ioutil.ReadAll(res.Body)
		res.Body.Close()
		if err != nil {
			return nil, fmt.Errorf("failed to read request body for GET %q: %v", getURL, err)
		}
		if res.StatusCode != http.StatusOK {
			return nil, fmt.Errorf("http error %d GET %q: %q: %v", res.StatusCode, getURL, string(body), err)
		}

		var rcList k8sapi.ReplicationControllerList
		if err := json.Unmarshal(body, &rcList); err != nil {
			return nil, fmt.Errorf("failed to decode list of pod resources: %v", err)
		}
		return rcList.Items, nil
	}
	return nil, fmt.Errorf("client not configed")
}
// Returns all RCs in the cluster.
Returns all RCs in the cluster.
// Returns all RCs in the cluster .
func (c *ClientWrapper) GetDefaultReplicationControllers() ([]k8sapi.ReplicationController, error) {
	if c.Client != nil {
		ctx := context.TODO()
		getURL := c.apiUrl + "/namespaces/default/replicationcontrollers"
		req, err := http.NewRequest("GET", getURL, nil)
		if err != nil {
			return nil, fmt.Errorf("failed to create request: GET %q : %v", getURL, err)
		}
		res, err := ctxhttp.Do(ctx, c.httpClient, req)
		if err != nil {
			return nil, fmt.Errorf("failed to make request: GET %q: %v", getURL, err)
		}
		body, err := ioutil.ReadAll(res.Body)
		res.Body.Close()
		if err != nil {
			return nil, fmt.Errorf("failed to read request body for GET %q: %v", getURL, err)
		}
		if res.StatusCode != http.StatusOK {
			return nil, fmt.Errorf("http error %d GET %q: %q: %v", res.StatusCode, getURL, string(body), err)
		}
		var rcList k8sapi.ReplicationControllerList
		if err := json.Unmarshal(body, &rcList); err != nil {
			return nil, fmt.Errorf("failed to decode list of pod resources: %v", err)
		}
		return rcList.Items, nil
	}
	return nil, fmt.Errorf("client not configed")
}
func ( c * ClientWrapper ) GetDefaultReplicationControllers ( ) ( [ ] k8sapi . ReplicationController , error ) { if c . Client != nil { ctx := context . TODO ( ) getURL := c . apiUrl + " " req , err := http . NewRequest ( " " , getURL , nil ) if err != nil { return nil , fmt . Errorf ( " " , getURL , err ) } res , err := ctxhttp . Do ( ctx , c . httpClient , req ) if err != nil { return nil , fmt . Errorf ( " " , getURL , err ) } body , err := ioutil . ReadAll ( res . Body ) res . Body . Close ( ) if err != nil { return nil , fmt . Errorf ( " " , getURL , err ) } if res . StatusCode != http . StatusOK { return nil , fmt . Errorf ( " " , res . StatusCode , getURL , string ( body ) , err ) } var rcList k8sapi . ReplicationControllerList if err := json . Unmarshal ( body , & rcList ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } return rcList . Items , nil } return nil , fmt . Errorf ( " " ) }
Returns all RCs in the cluster.
Returns all RCs in the cluster .
// Make request to Kubernetes API