Clients should not check conditions, UpdateStatus() is inconsistent

Corrects some of the cargo culting that has crept into the API.
This commit is contained in:
Clayton Coleman
2015-03-20 18:22:51 -04:00
parent d96d8a9faf
commit b1ab14315b
19 changed files with 32 additions and 163 deletions

View File

@@ -190,6 +190,10 @@ func (r *Request) Name(resourceName string) *Request {
if r.err != nil {
return r
}
if len(resourceName) == 0 {
r.err = fmt.Errorf("resource name may not be empty")
return r
}
if len(r.resourceName) != 0 {
r.err = fmt.Errorf("resource name already set to %q, cannot change to %q", r.resourceName, resourceName)
return r