MCPcopy
hub / github.com/kubernetes/client-go / Delete

Method Delete

dynamic/simple.go:203–221  ·  view source on GitHub ↗
(name string, opts *metav1.DeleteOptions, subresources ...string)

Source from the content-addressed store, hash-verified

201}
202
203func (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
223func (c *dynamicResourceClient) DeleteCollection(opts *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
224 if opts == nil {

Callers

nothing calls this directly

Calls 8

makeURLSegmentsMethod · 0.95
BodyMethod · 0.80
AbsPathMethod · 0.80
ErrorfMethod · 0.65
DoMethod · 0.65
DeleteMethod · 0.65
ErrorMethod · 0.65
EncodeMethod · 0.45

Tested by

no test coverage detected