-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.go
46 lines (39 loc) · 933 Bytes
/
main.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
package main
import (
"context"
"log"
"os"
"path/filepath"
"time"
"github.com/forbearing/k8s/clusterrole"
)
var (
ctx, cancel = context.WithTimeout(context.Background(), time.Minute*10)
namespace = "test"
kubeconfig = filepath.Join(os.Getenv("HOME"), ".kube/config")
filename = "../../testdata/examples/clusterrole.yaml"
name = "myclusterrole"
label = "type=clusterrole"
)
func main() {
ClusterRole_Create()
//ClusterRole_Update()
//ClusterRole_Apply()
//ClusterRole_Delete()
//ClusterRole_Get()
//ClusterRole_List()
//ClusterRole_Watch()
//ClusterRole_Informer()
//ClusterRole_Tools()
}
func checkErr(name string, val interface{}, err error) {
if err != nil {
log.Printf("%s failed: %v\n", name, err)
} else {
log.Printf("%s success: %v\n", name, val)
}
}
// cleanup will delete or prune created deployments.
func cleanup(handler *clusterrole.Handler) {
handler.Delete(name)
}