(obj *unstructured.Unstructured, opts metav1.UpdateOptions)
| 165 | } |
| 166 | |
| 167 | func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) { |
| 168 | accessor, err := meta.Accessor(obj) |
| 169 | if err != nil { |
| 170 | return nil, err |
| 171 | } |
| 172 | name := accessor.GetName() |
| 173 | if len(name) == 0 { |
| 174 | return nil, fmt.Errorf("name is required") |
| 175 | } |
| 176 | |
| 177 | outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) |
| 178 | if err != nil { |
| 179 | return nil, err |
| 180 | } |
| 181 | |
| 182 | result := c.client.client. |
| 183 | Put(). |
| 184 | AbsPath(append(c.makeURLSegments(name), "status")...). |
| 185 | Body(outBytes). |
| 186 | SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). |
| 187 | Do() |
| 188 | if err := result.Error(); err != nil { |
| 189 | return nil, err |
| 190 | } |
| 191 | |
| 192 | retBytes, err := result.Raw() |
| 193 | if err != nil { |
| 194 | return nil, err |
| 195 | } |
| 196 | uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes) |
| 197 | if err != nil { |
| 198 | return nil, err |
| 199 | } |
| 200 | return uncastObj.(*unstructured.Unstructured), nil |
| 201 | } |
| 202 | |
| 203 | func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions, subresources ...string) error { |
| 204 | if len(name) == 0 { |
nothing calls this directly
no test coverage detected