-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
74 lines (70 loc) · 1.83 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package main
import (
"os"
nvidiav1 "github.com/NVIDIA/gpu-operator/api/v1"
controllergen "github.com/rancher/wrangler/v2/pkg/controller-gen"
"github.com/rancher/wrangler/v2/pkg/controller-gen/args"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
volschv1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
const (
oneblockCoreGV = "ml.oneblock.ai"
oneblockMgmtGV = "management.oneblock.ai"
kubeRayGV = "ray.io"
nvidiaGV = "nvidia.com"
volcanoSchedulingGV = "scheduling.volcano.sh"
)
func main() {
os.Unsetenv("GOPATH")
controllergen.Run(args.Options{
OutputPackage: "github.com/oneblock-ai/oneblock/pkg/generated",
Boilerplate: "hack/boilerplate.go.txt",
Groups: map[string]args.Group{
oneblockCoreGV: {
PackageName: oneblockCoreGV,
Types: []interface{}{
// All structs with an embedded ObjectMeta field will be picked up
"./pkg/apis/ml.oneblock.ai/v1",
},
GenerateTypes: true,
GenerateClients: true,
},
oneblockMgmtGV: {
PackageName: oneblockMgmtGV,
Types: []interface{}{
// All structs with an embedded ObjectMeta field will be picked up
"./pkg/apis/management.oneblock.ai/v1",
},
GenerateTypes: true,
GenerateClients: true,
},
kubeRayGV: {
PackageName: kubeRayGV,
Types: []interface{}{
rayv1.RayCluster{},
rayv1.RayJob{},
rayv1.RayService{},
},
GenerateTypes: false,
GenerateClients: true,
},
nvidiaGV: {
PackageName: nvidiaGV,
Types: []interface{}{
nvidiav1.ClusterPolicy{},
},
GenerateTypes: false,
GenerateClients: true,
},
volcanoSchedulingGV: {
PackageName: volcanoSchedulingGV,
Types: []interface{}{
volschv1.PodGroup{},
volschv1.Queue{},
},
GenerateTypes: false,
GenerateClients: true,
},
},
})
}