Merge pull request #1137 from derekwaynecarr/name_vs_id_fixup

Fixup name vs ID terminology
This commit is contained in:
Clayton Coleman 2014-09-03 10:55:04 -04:00
commit 42eea82461
3 changed files with 28 additions and 28 deletions

View File

@ -52,7 +52,7 @@ cluster/kubecfg.sh list pods
You'll see a single redis master pod. It will also display the machine that the pod is running on once it gets placed (may take up to thirty seconds). You'll see a single redis master pod. It will also display the machine that the pod is running on once it gets placed (may take up to thirty seconds).
``` ```
Name Image(s) Host Labels ID Image(s) Host Labels
---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
redis-master-2 dockerfile/redis kubernetes-minion-3.c.briandpe-api.internal name=redis-master redis-master-2 dockerfile/redis kubernetes-minion-3.c.briandpe-api.internal name=redis-master
``` ```
@ -91,7 +91,7 @@ to create the service with the `kubecfg` cli:
```shell ```shell
$ cluster/kubecfg.sh -c examples/guestbook/redis-master-service.json create services $ cluster/kubecfg.sh -c examples/guestbook/redis-master-service.json create services
Name Labels Selector Port ID Labels Selector Port
---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
redismaster name=redis-master 10000 redismaster name=redis-master 10000
``` ```
@ -135,7 +135,7 @@ to create the replication controller by running:
```shell ```shell
$ cluster/kubecfg.sh -c examples/guestbook/redis-slave-controller.json create replicationControllers $ cluster/kubecfg.sh -c examples/guestbook/redis-slave-controller.json create replicationControllers
Name Image(s) Selector Replicas ID Image(s) Selector Replicas
---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
redisSlaveController brendanburns/redis-slave name=redisslave 2 redisSlaveController brendanburns/redis-slave name=redisslave 2
``` ```
@ -150,7 +150,7 @@ Once that's up you can list the pods in the cluster, to verify that the master a
```shell ```shell
$ cluster/kubecfg.sh list pods $ cluster/kubecfg.sh list pods
Name Image(s) Host Labels ID Image(s) Host Labels
---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
redis-master-2 dockerfile/redis kubernetes-minion-3.c.briandpe-api.internal name=redis-master redis-master-2 dockerfile/redis kubernetes-minion-3.c.briandpe-api.internal name=redis-master
4d65822107fcfd52 brendanburns/redis-slave kubernetes-minion-3.c.briandpe-api.internal name=redisslave,replicationController=redisSlaveController 4d65822107fcfd52 brendanburns/redis-slave kubernetes-minion-3.c.briandpe-api.internal name=redisslave,replicationController=redisSlaveController
@ -184,7 +184,7 @@ Now that you have created the service specification, create it in your cluster w
```shell ```shell
$ cluster/kubecfg.sh -c examples/guestbook/redis-slave-service.json create services $ cluster/kubecfg.sh -c examples/guestbook/redis-slave-service.json create services
Name Labels Selector Port ID Labels Selector Port
---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
redisslave name=redisslave name=redisslave 10001 redisslave name=redisslave name=redisslave 10001
``` ```
@ -225,7 +225,7 @@ Using this file, you can turn up your frontend with:
```shell ```shell
$ cluster/kubecfg.sh -c examples/guestbook/frontend-controller.json create replicationControllers $ cluster/kubecfg.sh -c examples/guestbook/frontend-controller.json create replicationControllers
Name Image(s) Selector Replicas ID Image(s) Selector Replicas
---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
frontendController brendanburns/php-redis name=frontend 3 frontendController brendanburns/php-redis name=frontend 3
``` ```
@ -234,7 +234,7 @@ Once that's up (it may take ten to thirty seconds to create the pods) you can li
```shell ```shell
$ cluster/kubecfg.sh list pods $ cluster/kubecfg.sh list pods
Name Image(s) Host Labels ID Image(s) Host Labels
---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
redis-master-2 dockerfile/redis kubernetes-minion-3.c.briandpe-api.internal name=redis-master redis-master-2 dockerfile/redis kubernetes-minion-3.c.briandpe-api.internal name=redis-master
4d65822107fcfd52 brendanburns/redis-slave kubernetes-minion-3.c.briandpe-api.internal name=redisslave,replicationController=redisSlaveController 4d65822107fcfd52 brendanburns/redis-slave kubernetes-minion-3.c.briandpe-api.internal name=redisslave,replicationController=redisSlaveController

View File

@ -47,8 +47,8 @@ type Interface interface {
// PodInterface has methods to work with Pod resources. // PodInterface has methods to work with Pod resources.
type PodInterface interface { type PodInterface interface {
ListPods(selector labels.Selector) (api.PodList, error) ListPods(selector labels.Selector) (api.PodList, error)
GetPod(name string) (api.Pod, error) GetPod(id string) (api.Pod, error)
DeletePod(name string) error DeletePod(id string) error
CreatePod(api.Pod) (api.Pod, error) CreatePod(api.Pod) (api.Pod, error)
UpdatePod(api.Pod) (api.Pod, error) UpdatePod(api.Pod) (api.Pod, error)
} }
@ -56,7 +56,7 @@ type PodInterface interface {
// ReplicationControllerInterface has methods to work with ReplicationController resources. // ReplicationControllerInterface has methods to work with ReplicationController resources.
type ReplicationControllerInterface interface { type ReplicationControllerInterface interface {
ListReplicationControllers(selector labels.Selector) (api.ReplicationControllerList, error) ListReplicationControllers(selector labels.Selector) (api.ReplicationControllerList, error)
GetReplicationController(name string) (api.ReplicationController, error) GetReplicationController(id string) (api.ReplicationController, error)
CreateReplicationController(api.ReplicationController) (api.ReplicationController, error) CreateReplicationController(api.ReplicationController) (api.ReplicationController, error)
UpdateReplicationController(api.ReplicationController) (api.ReplicationController, error) UpdateReplicationController(api.ReplicationController) (api.ReplicationController, error)
DeleteReplicationController(string) error DeleteReplicationController(string) error
@ -65,7 +65,7 @@ type ReplicationControllerInterface interface {
// ServiceInterface has methods to work with Service resources. // ServiceInterface has methods to work with Service resources.
type ServiceInterface interface { type ServiceInterface interface {
GetService(name string) (api.Service, error) GetService(id string) (api.Service, error)
CreateService(api.Service) (api.Service, error) CreateService(api.Service) (api.Service, error)
UpdateService(api.Service) (api.Service, error) UpdateService(api.Service) (api.Service, error)
DeleteService(string) error DeleteService(string) error
@ -247,15 +247,15 @@ func (c *Client) ListPods(selector labels.Selector) (result api.PodList, err err
return return
} }
// GetPod takes the name of the pod, and returns the corresponding Pod object, and an error if it occurs. // GetPod takes the id of the pod, and returns the corresponding Pod object, and an error if it occurs
func (c *Client) GetPod(name string) (result api.Pod, err error) { func (c *Client) GetPod(id string) (result api.Pod, err error) {
err = c.Get().Path("pods").Path(name).Do().Into(&result) err = c.Get().Path("pods").Path(id).Do().Into(&result)
return return
} }
// DeletePod takes the name of the pod, and returns an error if one occurs. // DeletePod takes the id of the pod, and returns an error if one occurs
func (c *Client) DeletePod(name string) error { func (c *Client) DeletePod(id string) error {
return c.Delete().Path("pods").Path(name).Do().Error() return c.Delete().Path("pods").Path(id).Do().Error()
} }
// CreatePod takes the representation of a pod. Returns the server's representation of the pod, and an error, if it occurs. // CreatePod takes the representation of a pod. Returns the server's representation of the pod, and an error, if it occurs.
@ -281,8 +281,8 @@ func (c *Client) ListReplicationControllers(selector labels.Selector) (result ap
} }
// GetReplicationController returns information about a particular replication controller. // GetReplicationController returns information about a particular replication controller.
func (c *Client) GetReplicationController(name string) (result api.ReplicationController, err error) { func (c *Client) GetReplicationController(id string) (result api.ReplicationController, err error) {
err = c.Get().Path("replicationControllers").Path(name).Do().Into(&result) err = c.Get().Path("replicationControllers").Path(id).Do().Into(&result)
return return
} }
@ -303,8 +303,8 @@ func (c *Client) UpdateReplicationController(controller api.ReplicationControlle
} }
// DeleteReplicationController deletes an existing replication controller. // DeleteReplicationController deletes an existing replication controller.
func (c *Client) DeleteReplicationController(name string) error { func (c *Client) DeleteReplicationController(id string) error {
return c.Delete().Path("replicationControllers").Path(name).Do().Error() return c.Delete().Path("replicationControllers").Path(id).Do().Error()
} }
// WatchReplicationControllers returns a watch.Interface that watches the requested controllers. // WatchReplicationControllers returns a watch.Interface that watches the requested controllers.
@ -324,8 +324,8 @@ func (c *Client) ListServices(selector labels.Selector) (list api.ServiceList, e
} }
// GetService returns information about a particular service. // GetService returns information about a particular service.
func (c *Client) GetService(name string) (result api.Service, err error) { func (c *Client) GetService(id string) (result api.Service, err error) {
err = c.Get().Path("services").Path(name).Do().Into(&result) err = c.Get().Path("services").Path(id).Do().Into(&result)
return return
} }
@ -346,8 +346,8 @@ func (c *Client) UpdateService(svc api.Service) (result api.Service, err error)
} }
// DeleteService deletes an existing service. // DeleteService deletes an existing service.
func (c *Client) DeleteService(name string) error { func (c *Client) DeleteService(id string) error {
return c.Delete().Path("services").Path(name).Do().Error() return c.Delete().Path("services").Path(id).Do().Error()
} }
// WatchServices returns a watch.Interface that watches the requested services. // WatchServices returns a watch.Interface that watches the requested services.

View File

@ -137,9 +137,9 @@ func (h *HumanReadablePrinter) validatePrintHandlerFunc(printFunc reflect.Value)
return nil return nil
} }
var podColumns = []string{"Name", "Image(s)", "Host", "Labels"} var podColumns = []string{"ID", "Image(s)", "Host", "Labels"}
var replicationControllerColumns = []string{"Name", "Image(s)", "Selector", "Replicas"} var replicationControllerColumns = []string{"ID", "Image(s)", "Selector", "Replicas"}
var serviceColumns = []string{"Name", "Labels", "Selector", "Port"} var serviceColumns = []string{"ID", "Labels", "Selector", "Port"}
var minionColumns = []string{"Minion identifier"} var minionColumns = []string{"Minion identifier"}
var statusColumns = []string{"Status"} var statusColumns = []string{"Status"}