| 201 | } |
| 202 | |
| 203 | func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions, subresources ...string) error { |
| 204 | if len(name) == 0 { |
| 205 | return fmt.Errorf("name is required") |
| 206 | } |
| 207 | if opts == nil { |
| 208 | opts = &metav1.DeleteOptions{} |
| 209 | } |
| 210 | deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), opts) |
| 211 | if err != nil { |
| 212 | return err |
| 213 | } |
| 214 | |
| 215 | result := c.client.client. |
| 216 | Delete(). |
| 217 | AbsPath(append(c.makeURLSegments(name), subresources...)...). |
| 218 | Body(deleteOptionsByte). |
| 219 | Do() |
| 220 | return result.Error() |
| 221 | } |
| 222 | |
| 223 | func (c *dynamicResourceClient) DeleteCollection(opts *metav1.DeleteOptions, listOptions metav1.ListOptions) error { |
| 224 | if opts == nil { |