Fix UpdateStatus
This commit is contained in:
@@ -283,10 +283,17 @@ func (c *$.type|privatePlural$) Update($.type|private$ *$.type|raw$) (result *$.
|
||||
`
|
||||
|
||||
var updateStatusTemplate = `
|
||||
func (c *$.type|privatePlural$) UpdateStatus($.type|private$ *$.type|raw$) (*$.type|raw$, error) {
|
||||
result := &$.type|raw${}
|
||||
err := c.client.Put().Resource("$.type|privatePlural$").Name($.type|private$.Name).SubResource("status").Body($.type|private$).Do().Into(result)
|
||||
return result, err
|
||||
func (c *$.type|privatePlural$) UpdateStatus($.type|private$ *$.type|raw$) (result *$.type|raw$, err error) {
|
||||
result = &$.type|raw${}
|
||||
err = c.client.Put().
|
||||
$if .namespaced$Namespace(c.ns).$end$
|
||||
Resource("$.type|privatePlural$").
|
||||
Name($.type|private$.Name).
|
||||
SubResource("status").
|
||||
Body($.type|private$).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
`
|
||||
|
||||
|
@@ -80,10 +80,17 @@ func (c *testTypes) Update(testType *testgroup.TestType) (result *testgroup.Test
|
||||
return
|
||||
}
|
||||
|
||||
func (c *testTypes) UpdateStatus(testType *testgroup.TestType) (*testgroup.TestType, error) {
|
||||
result := &testgroup.TestType{}
|
||||
err := c.client.Put().Resource("testTypes").Name(testType.Name).SubResource("status").Body(testType).Do().Into(result)
|
||||
return result, err
|
||||
func (c *testTypes) UpdateStatus(testType *testgroup.TestType) (result *testgroup.TestType, err error) {
|
||||
result = &testgroup.TestType{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("testTypes").
|
||||
Name(testType.Name).
|
||||
SubResource("status").
|
||||
Body(testType).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the testType and deletes it. Returns an error if one occurs.
|
||||
|
Reference in New Issue
Block a user