@@ -331,6 +331,53 @@ Although these concerns are not unsolvable, they lead to the conclusion that
331
331
a Kubectl plugin should be our primary approach to providing visibility here,
332
332
with a possibility of adding policies to status at a later point.
333
333
334
+ # ## Conditions
335
+ Controllers using the Gateway API policy attachment model SHOULD populate the
336
+ following condition and reasons on policy resources to provide a consistent
337
+ experience across implementations.
338
+
339
+ ` ` ` go
340
+ // PolicyConditionType is a type of condition for a policy.
341
+ type PolicyConditionType string
342
+
343
+ // PolicyConditionReason is a reason for a policy condition.
344
+ type PolicyConditionReason string
345
+
346
+ const (
347
+ // PolicyConditionAccepted indicates whether the policy has been accepted or rejected
348
+ // by a targeted resource, and why.
349
+ //
350
+ // Possible reasons for this condition to be True are:
351
+ //
352
+ // * "Accepted"
353
+ //
354
+ // Possible reasons for this condition to be False are:
355
+ //
356
+ // * "Conflicted"
357
+ // * "Invalid"
358
+ // * "TargetNotFound"
359
+ //
360
+ PolicyConditionAccepted PolicyConditionType = "Accepted"
361
+
362
+ // PolicyReasonAccepted is used with the "Accepted" condition when the policy has been
363
+ // accepted by the targeted resource.
364
+ PolicyReasonAccepted PolicyConditionReason = "Accepted"
365
+
366
+ // PolicyReasonConflicted is used with the "Accepted" condition when the policy has not
367
+ // been accepted by a targeted resource because there is another policy that targets the same
368
+ // resource and a merge is not possible.
369
+ PolicyReasonConflicted PolicyConditionReason = "Conflicted"
370
+
371
+ // PolicyReasonInvalid is used with the "Accepted" condition when the policy is syntactically
372
+ // or semantically invalid.
373
+ PolicyReasonInvalid PolicyConditionReason = "Invalid"
374
+
375
+ // PolicyReasonTargetNotFound is used with the "Accepted" condition when the policy is attached to
376
+ // an invalid target resource
377
+ PolicyReasonTargetNotFound PolicyConditionReason = "TargetNotFound"
378
+ )
379
+ ` ` `
380
+
334
381
# ## Interaction with Custom Filters and other extension points
335
382
There are multiple methods of custom extension in the Gateway API. Policy
336
383
attachment and custom Route filters are two of these. Policy attachment is
0 commit comments