github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/internal/api/boom/v1/boom.go (about) 1 // +kubebuilder:object:generate=true 2 // +groupName=caos.ch 3 package v1 4 5 import ( 6 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 7 "k8s.io/apimachinery/pkg/runtime/schema" 8 "sigs.k8s.io/controller-runtime/pkg/scheme" 9 ) 10 11 var ( 12 // GroupVersion is group version used to register these objects 13 GroupVersion = schema.GroupVersion{Group: "caos.ch", Version: "v1"} 14 15 // SchemeBuilder is used to add go types to the GroupVersionKind scheme 16 SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} 17 18 // AddToScheme adds the types in this group-version to the given scheme. 19 AddToScheme = SchemeBuilder.AddToScheme 20 ) 21 22 // +kubebuilder:storageversion 23 // +kubebuilder:object:root=true 24 // +kubebuilder:crd=Boom 25 type Boom struct { 26 metav1.TypeMeta `json:",inline"` 27 metav1.ObjectMeta `json:"metadata,omitempty"` 28 29 Spec *Empty `json:"spec,omitempty"` 30 Status Status `json:"status,omitempty"` 31 } 32 33 type Status struct { 34 // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster 35 // Important: Run "make" to regenerate code after modifying this file 36 } 37 38 type Empty struct{} 39 40 // +kubebuilder:object:root=true 41 type BoomList struct { 42 metav1.TypeMeta `json:",inline"` 43 metav1.ListMeta `json:"metadata,omitempty"` 44 Items []Boom `json:"items"` 45 } 46 47 func init() { 48 SchemeBuilder.Register(&Boom{}, &BoomList{}) 49 } 50 51 func GetEmpty(namespace, name string) map[string]interface{} { 52 return map[string]interface{}{ 53 "apiVersion": "caos.ch/v1", 54 "kind": "Boom", 55 "metadata": map[string]interface{}{ 56 "name": name, 57 "namespace": namespace, 58 }, 59 "spec": map[string]interface{}{ 60 "forceApply": true, 61 "postApply": map[string]interface{}{ 62 "deploy": false, 63 }, 64 "preApply": map[string]interface{}{ 65 "deploy": false, 66 }, 67 "metricCollection": map[string]interface{}{ 68 "deploy": false, 69 }, 70 "logCollection": map[string]interface{}{ 71 "deploy": false, 72 }, 73 "nodeMetricsExporter": map[string]interface{}{ 74 "deploy": false, 75 }, 76 "systemdMetricsExporter": map[string]interface{}{ 77 "deploy": false, 78 }, 79 "monitoring": map[string]interface{}{ 80 "deploy": false, 81 }, 82 "apiGateway": map[string]interface{}{ 83 "deploy": false, 84 }, 85 "kubeMetricsExporter": map[string]interface{}{ 86 "deploy": false, 87 }, 88 "reconciling": map[string]interface{}{ 89 "deploy": false, 90 }, 91 "metricsPersisting": map[string]interface{}{ 92 "deploy": false, 93 }, 94 "logsPersisting": map[string]interface{}{ 95 "deploy": false, 96 }, 97 "metricsServer": map[string]interface{}{ 98 "deploy": false, 99 }, 100 }, 101 } 102 }