require names for gets

This commit is contained in:
deads2k
2014-12-11 10:13:10 -05:00
parent 5523e0344a
commit fa900e5d67
7 changed files with 101 additions and 13 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package client
import (
"errors"
"fmt"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
@@ -59,6 +60,10 @@ func (c *services) List(selector labels.Selector) (result *api.ServiceList, err
// Get returns information about a particular service.
func (c *services) Get(name string) (result *api.Service, err error) {
if len(name) == 0 {
return nil, errors.New("name is required parameter to Get")
}
result = &api.Service{}
err = c.r.Get().Namespace(c.ns).Path("services").Path(name).Do().Into(result)
return