-
Notifications
You must be signed in to change notification settings - Fork 0
/
rawdelete.go
59 lines (53 loc) · 1.33 KB
/
rawdelete.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package k8s
// Delete removes a Resource
/*
func (rc *RawClient) Delete(r Resource) (Results, error) {
res, err := rc.findManyResults("ingresses", search)
if err != nil {
return res, err
}
return res, nil
}
*/
// RawDeleteRS removes the named ReplicaSet
func (rc *RawClient) RawDeleteRS(name string) ([]byte, error) {
d, err := rc.cs.ExtensionsV1beta1().RESTClient().Delete().Namespace(rc.ns).Resource("replicasets").Name(name).Body(&rc.delOpts).DoRaw()
return d, err
}
/*
// RawDelete removes the specified kind by the name provided
func (rc *RawClient) rawDelete(kind, name string) error {
switch kind {
case "replicasets":
err := rc.cs.ExtensionsV1beta1().RESTClient().Delete().Namespace(rc.ns).Resource("replicasets").Name("blahblah").Body(&rc.delOpts).DoRaw()
return err
case "pods":
all, errd = rc.RawAllPods()
if errd != nil {
return all, errd
}
case "nodes":
all, errd = rc.RawAllNodes()
if errd != nil {
return all, errd
}
case "deployments":
all, errd = rc.RawAllDeployments()
if errd != nil {
return all, errd
}
case "services":
all, errd = rc.RawAllSvc()
if errd != nil {
return all, errd
}
case "ingresses":
all, errd = rc.RawAllIngress()
if errd != nil {
return all, errd
}
default:
return fmt.Errorf("No resources found for the given request")
}
}
*/