forked from kubevirt/controller-lifecycle-operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
status.go
66 lines (64 loc) · 1.82 KB
/
status.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
package openapi
import extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
// OperatorConfigStatus provides JSONSchemaProps for the Status struct
func OperatorConfigStatus(statusName string) extv1.JSONSchemaProps {
return extv1.JSONSchemaProps{
Type: "object",
Description: statusName + " defines the status of the installation",
Properties: map[string]extv1.JSONSchemaProps{
"targetVersion": {
Description: "The desired version of the resource",
Type: "string",
},
"observedVersion": {
Description: "The observed version of the resource",
Type: "string",
},
"operatorVersion": {
Description: "The version of the resource as defined by the operator",
Type: "string",
},
"phase": {
Description: "Phase is the current phase of the deployment",
Type: "string",
},
"conditions": {
Description: "A list of current conditions of the resource",
Type: "array",
Items: &extv1.JSONSchemaPropsOrArray{
Schema: &extv1.JSONSchemaProps{
Type: "object",
Description: "Condition represents the state of the operator's reconciliation functionality.",
Properties: map[string]extv1.JSONSchemaProps{
"lastHeartbeatTime": {
Type: "string",
Format: "date-time",
},
"lastTransitionTime": {
Type: "string",
Format: "date-time",
},
"message": {
Type: "string",
},
"reason": {
Type: "string",
},
"status": {
Type: "string",
},
"type": {
Description: "ConditionType is the state of the operator's reconciliation functionality.",
Type: "string",
},
},
Required: []string{
"status",
"type",
},
},
},
},
},
}
}