@@ -17,9 +17,13 @@ limitations under the License.
17
17
package v1alpha1
18
18
19
19
import (
20
+ "github.com/awslabs/operatorpkg/status"
20
21
corev1 "k8s.io/api/core/v1"
21
22
networking "k8s.io/api/networking/v1"
22
23
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24
+ "k8s.io/apimachinery/pkg/runtime"
25
+ "k8s.io/apimachinery/pkg/runtime/schema"
26
+ "k8s.io/apimachinery/pkg/types"
23
27
)
24
28
25
29
// PolicyReference is the reference to the network policy resource
@@ -105,7 +109,167 @@ type PolicyEndpointStatus struct {
105
109
// Important: Run "make" to regenerate code after modifying this file
106
110
107
111
// +optional
108
- Conditions []PolicyEndpointCondition `json:"conditions,omitempty"`
112
+ Conditions []status.Condition `json:"conditions,omitempty"`
113
+ }
114
+
115
+ // DeepCopyObject implements status.Object.
116
+ func (* PolicyEndpointStatus ) DeepCopyObject () runtime.Object {
117
+ panic ("unimplemented" )
118
+ }
119
+
120
+ // GetAnnotations implements status.Object.
121
+ func (* PolicyEndpointStatus ) GetAnnotations () map [string ]string {
122
+ panic ("unimplemented" )
123
+ }
124
+
125
+ // GetCreationTimestamp implements status.Object.
126
+ func (* PolicyEndpointStatus ) GetCreationTimestamp () metav1.Time {
127
+ panic ("unimplemented" )
128
+ }
129
+
130
+ // GetDeletionGracePeriodSeconds implements status.Object.
131
+ func (* PolicyEndpointStatus ) GetDeletionGracePeriodSeconds () * int64 {
132
+ panic ("unimplemented" )
133
+ }
134
+
135
+ // GetDeletionTimestamp implements status.Object.
136
+ func (* PolicyEndpointStatus ) GetDeletionTimestamp () * metav1.Time {
137
+ panic ("unimplemented" )
138
+ }
139
+
140
+ // GetFinalizers implements status.Object.
141
+ func (* PolicyEndpointStatus ) GetFinalizers () []string {
142
+ panic ("unimplemented" )
143
+ }
144
+
145
+ // GetGenerateName implements status.Object.
146
+ func (* PolicyEndpointStatus ) GetGenerateName () string {
147
+ panic ("unimplemented" )
148
+ }
149
+
150
+ // GetGeneration implements status.Object.
151
+ func (* PolicyEndpointStatus ) GetGeneration () int64 {
152
+ panic ("unimplemented" )
153
+ }
154
+
155
+ // GetLabels implements status.Object.
156
+ func (* PolicyEndpointStatus ) GetLabels () map [string ]string {
157
+ panic ("unimplemented" )
158
+ }
159
+
160
+ // GetManagedFields implements status.Object.
161
+ func (* PolicyEndpointStatus ) GetManagedFields () []metav1.ManagedFieldsEntry {
162
+ panic ("unimplemented" )
163
+ }
164
+
165
+ // GetName implements status.Object.
166
+ func (* PolicyEndpointStatus ) GetName () string {
167
+ panic ("unimplemented" )
168
+ }
169
+
170
+ // GetNamespace implements status.Object.
171
+ func (* PolicyEndpointStatus ) GetNamespace () string {
172
+ panic ("unimplemented" )
173
+ }
174
+
175
+ // GetObjectKind implements status.Object.
176
+ func (* PolicyEndpointStatus ) GetObjectKind () schema.ObjectKind {
177
+ panic ("unimplemented" )
178
+ }
179
+
180
+ // GetOwnerReferences implements status.Object.
181
+ func (* PolicyEndpointStatus ) GetOwnerReferences () []metav1.OwnerReference {
182
+ panic ("unimplemented" )
183
+ }
184
+
185
+ // GetResourceVersion implements status.Object.
186
+ func (* PolicyEndpointStatus ) GetResourceVersion () string {
187
+ panic ("unimplemented" )
188
+ }
189
+
190
+ // GetSelfLink implements status.Object.
191
+ func (* PolicyEndpointStatus ) GetSelfLink () string {
192
+ panic ("unimplemented" )
193
+ }
194
+
195
+ // GetUID implements status.Object.
196
+ func (* PolicyEndpointStatus ) GetUID () types.UID {
197
+ panic ("unimplemented" )
198
+ }
199
+
200
+ // SetAnnotations implements status.Object.
201
+ func (* PolicyEndpointStatus ) SetAnnotations (annotations map [string ]string ) {
202
+ panic ("unimplemented" )
203
+ }
204
+
205
+ // SetCreationTimestamp implements status.Object.
206
+ func (* PolicyEndpointStatus ) SetCreationTimestamp (timestamp metav1.Time ) {
207
+ panic ("unimplemented" )
208
+ }
209
+
210
+ // SetDeletionGracePeriodSeconds implements status.Object.
211
+ func (* PolicyEndpointStatus ) SetDeletionGracePeriodSeconds (* int64 ) {
212
+ panic ("unimplemented" )
213
+ }
214
+
215
+ // SetDeletionTimestamp implements status.Object.
216
+ func (* PolicyEndpointStatus ) SetDeletionTimestamp (timestamp * metav1.Time ) {
217
+ panic ("unimplemented" )
218
+ }
219
+
220
+ // SetFinalizers implements status.Object.
221
+ func (* PolicyEndpointStatus ) SetFinalizers (finalizers []string ) {
222
+ panic ("unimplemented" )
223
+ }
224
+
225
+ // SetGenerateName implements status.Object.
226
+ func (* PolicyEndpointStatus ) SetGenerateName (name string ) {
227
+ panic ("unimplemented" )
228
+ }
229
+
230
+ // SetGeneration implements status.Object.
231
+ func (* PolicyEndpointStatus ) SetGeneration (generation int64 ) {
232
+ panic ("unimplemented" )
233
+ }
234
+
235
+ // SetLabels implements status.Object.
236
+ func (* PolicyEndpointStatus ) SetLabels (labels map [string ]string ) {
237
+ panic ("unimplemented" )
238
+ }
239
+
240
+ // SetManagedFields implements status.Object.
241
+ func (* PolicyEndpointStatus ) SetManagedFields (managedFields []metav1.ManagedFieldsEntry ) {
242
+ panic ("unimplemented" )
243
+ }
244
+
245
+ // SetName implements status.Object.
246
+ func (* PolicyEndpointStatus ) SetName (name string ) {
247
+ panic ("unimplemented" )
248
+ }
249
+
250
+ // SetNamespace implements status.Object.
251
+ func (* PolicyEndpointStatus ) SetNamespace (namespace string ) {
252
+ panic ("unimplemented" )
253
+ }
254
+
255
+ // SetOwnerReferences implements status.Object.
256
+ func (* PolicyEndpointStatus ) SetOwnerReferences ([]metav1.OwnerReference ) {
257
+ panic ("unimplemented" )
258
+ }
259
+
260
+ // SetResourceVersion implements status.Object.
261
+ func (* PolicyEndpointStatus ) SetResourceVersion (version string ) {
262
+ panic ("unimplemented" )
263
+ }
264
+
265
+ // SetSelfLink implements status.Object.
266
+ func (* PolicyEndpointStatus ) SetSelfLink (selfLink string ) {
267
+ panic ("unimplemented" )
268
+ }
269
+
270
+ // SetUID implements status.Object.
271
+ func (* PolicyEndpointStatus ) SetUID (uid types.UID ) {
272
+ panic ("unimplemented" )
109
273
}
110
274
111
275
type PolicyEndpointConditionType string
@@ -115,26 +279,6 @@ const (
115
279
Updated PolicyEndpointConditionType = "PatchedPolicyEndpoint"
116
280
)
117
281
118
- // PolicyEndpointCondition describes the state of a PolicyEndpoint at a certain point.
119
- // For example, binpacking PE slices should be updated as a condition change
120
- type PolicyEndpointCondition struct {
121
- // Type of PolicyEndpoint condition.
122
- // +optional
123
- Type PolicyEndpointConditionType `json:"type"`
124
- // Status of the condition, one of True, False, Unknown.
125
- // +optional
126
- Status corev1.ConditionStatus `json:"status"`
127
- // Last time the condition transitioned from one status to another.
128
- // +optional
129
- LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
130
- // The reason for the condition's last transition.
131
- // +optional
132
- Reason string `json:"reason,omitempty"`
133
- // A human readable message indicating details about the transition.
134
- // +optional
135
- Message string `json:"message,omitempty"`
136
- }
137
-
138
282
//+kubebuilder:object:root=true
139
283
//+kubebuilder:subresource:status
140
284
@@ -159,3 +303,15 @@ type PolicyEndpointList struct {
159
303
func init () {
160
304
SchemeBuilder .Register (& PolicyEndpoint {}, & PolicyEndpointList {})
161
305
}
306
+
307
+ func (s * PolicyEndpoint ) GetConditions () []status.Condition {
308
+ return []status.Condition (s .Status .Conditions )
309
+ }
310
+
311
+ func (s * PolicyEndpoint ) SetConditions (conds []status.Condition ) {
312
+ s .Status .Conditions = conds
313
+ }
314
+
315
+ func (s * PolicyEndpoint ) StatusConditions () status.ConditionSet {
316
+ return status .NewReadyConditions ().For (s )
317
+ }
0 commit comments