-
Notifications
You must be signed in to change notification settings - Fork 185
/
destination.go
107 lines (105 loc) 路 3.05 KB
/
destination.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package crds
import (
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func NewDestination() *apiextensionsv1.CustomResourceDefinition {
return &apiextensionsv1.CustomResourceDefinition{
TypeMeta: metav1.TypeMeta{
Kind: "CustomResourceDefinition",
APIVersion: "apiextensions.k8s.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "destinations.odigos.io",
},
Spec: apiextensionsv1.CustomResourceDefinitionSpec{
Group: "odigos.io",
Names: apiextensionsv1.CustomResourceDefinitionNames{
Plural: "destinations",
Singular: "destination",
Kind: "Destination",
ListKind: "DestinationList",
},
Scope: apiextensionsv1.NamespaceScoped,
Versions: []apiextensionsv1.CustomResourceDefinitionVersion{
{
Name: "v1alpha1",
Served: true,
Storage: true,
Schema: &apiextensionsv1.CustomResourceValidation{
OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
Description: "Destination is the Schema for the destinations API",
Type: "object",
Properties: map[string]apiextensionsv1.JSONSchemaProps{
"apiVersion": {
Type: "string",
},
"kind": {
Type: "string",
},
"metadata": {
Type: "object",
},
"spec": {
Description: "DestinationSpec defines the desired state of Destination",
Type: "object",
Required: []string{
"data",
"destinationName",
"signals",
"type",
},
Properties: map[string]apiextensionsv1.JSONSchemaProps{
"data": {
Type: "object",
AdditionalProperties: &apiextensionsv1.JSONSchemaPropsOrBool{
Allows: true,
Schema: &apiextensionsv1.JSONSchemaProps{
Type: "string",
},
},
},
"destinationName": {
Type: "string",
},
"secretRef": {
Description: "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.",
Type: "object",
Properties: map[string]apiextensionsv1.JSONSchemaProps{
"name": {
Type: "string",
},
},
},
"signals": {
Type: "array",
Items: &apiextensionsv1.JSONSchemaPropsOrArray{
Schema: &apiextensionsv1.JSONSchemaProps{
Type: "string",
Enum: []apiextensionsv1.JSON{
{Raw: []byte(`"LOGS"`)},
{Raw: []byte(`"TRACES"`)},
{Raw: []byte(`"METRICS"`)},
},
},
},
},
"type": {
Type: "string",
},
},
},
"status": {
Type: "object",
},
},
},
},
Subresources: &apiextensionsv1.CustomResourceSubresources{
Status: &apiextensionsv1.CustomResourceSubresourceStatus{},
},
},
},
},
}
}