You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// IsTrue returns true if the Condition's status is "True".
88
-
// Note that the status can be "Unknown", so !IsTrue() is not the same as IsFalse().
89
-
func (ccCondition) IsTrue() bool {
90
-
returncc.Status==CONDITION_TRUE
91
-
}
92
-
93
-
// IsFalse returns true if the Condition's status is "False".
94
-
// Note that the status can be "Unknown", so !IsFalse() is not the same as IsTrue().
95
-
func (ccCondition) IsFalse() bool {
96
-
returncc.Status==CONDITION_FALSE
97
-
}
8
+
// These are standard condition types that can be used across resources
9
+
const (
10
+
// ReadyConditionType indicates whether the resource is ready
11
+
ReadyConditionType="Ready"
12
+
// AvailableConditionType indicates whether the resource is available
13
+
AvailableConditionType="Available"
14
+
// ReconcileSuccessConditionType indicates whether the last reconciliation was successful
15
+
ReconcileSuccessConditionType="ReconcileSuccess"
16
+
)
98
17
99
-
// IsUnknown returns true if the Condition's status is "Unknown".
100
-
func (ccCondition) IsUnknown() bool {
101
-
returncc.Status==CONDITION_UNKNOWN
102
-
}
18
+
// These are standard condition reasons that can be used across resources
19
+
const (
20
+
// ReconcileSuccessReason indicates that the reconciliation was successful
21
+
ReconcileSuccessReason="ReconcileSuccess"
22
+
// ReconcileErrorReason indicates that there was an error during reconciliation
23
+
ReconcileErrorReason="ReconcileError"
24
+
// ResourceAvailableReason indicates that the resource is available
25
+
ResourceAvailableReason="ResourceAvailable"
26
+
// ResourceUnavailableReason indicates that the resource is not available
27
+
ResourceUnavailableReason="ResourceUnavailable"
28
+
)
103
29
104
30
typeObjectReferencestruct {
105
31
// Name is the name of the referenced resource.
@@ -114,9 +40,8 @@ type NamespacedObjectReference struct {
114
40
Namespacestring`json:"namespace"`
115
41
}
116
42
117
-
// CommonStatus is a status shared by multiple resource.
118
-
// Note that a 'phase' is also part of the status, but it cannot be included in this struct.
119
-
// The reason is that we want to use string-like types for the phase, but the goddamn code generation does not support generics, no matter which annotations are added.
43
+
// CommonStatus is a status shared by multiple resources.
44
+
// It uses standard Kubernetes conditions for status representation.
120
45
typeCommonStatusstruct {
121
46
// ObservedGeneration is the generation of this resource that was last reconciled by the controller.
0 commit comments