1
1
# generated by datamodel-codegen:
2
- # timestamp: 2024-04-28T13:01:54 +00:00
2
+ # timestamp: 2024-04-28T19:06:26 +00:00
3
3
# k8s version: v1.30.0
4
4
5
5
from __future__ import annotations
6
6
7
- from enum import Enum
8
7
from typing import List , Optional
9
8
10
9
from pydantic import BaseModel , Field
@@ -99,36 +98,6 @@ class MatchCondition(BaseModel):
99
98
)
100
99
101
100
102
- class MatchPolicy (Enum ):
103
- Equivalent = "Equivalent"
104
- Exact = "Exact"
105
-
106
-
107
- class FailurePolicy (Enum ):
108
- Fail = "Fail"
109
- Ignore = "Ignore"
110
-
111
-
112
- class ReinvocationPolicy (Enum ):
113
- IfNeeded = "IfNeeded"
114
- Never = "Never"
115
-
116
-
117
- class SideEffects (Enum ):
118
- None_ = "None"
119
- NoneOnDryRun = "NoneOnDryRun"
120
- Some = "Some"
121
- Unknown = "Unknown"
122
-
123
-
124
- class Operation (Enum ):
125
- field_ = "*"
126
- CONNECT = "CONNECT"
127
- CREATE = "CREATE"
128
- DELETE = "DELETE"
129
- UPDATE = "UPDATE"
130
-
131
-
132
101
class NamedRuleWithOperations (BaseModel ):
133
102
apiGroups : Optional [List [str ]] = Field (
134
103
default = None ,
@@ -145,7 +114,7 @@ class NamedRuleWithOperations(BaseModel):
145
114
" Required."
146
115
),
147
116
)
148
- operations : Optional [List [Operation ]] = Field (
117
+ operations : Optional [List [str ]] = Field (
149
118
default = None ,
150
119
description = (
151
120
"Operations is the operations the admission hook cares about - CREATE,"
@@ -217,7 +186,7 @@ class RuleWithOperations(BaseModel):
217
186
" Required."
218
187
),
219
188
)
220
- operations : Optional [List [Operation ]] = Field (
189
+ operations : Optional [List [str ]] = Field (
221
190
default = None ,
222
191
description = (
223
192
"Operations is the operations the admission hook cares about - CREATE,"
@@ -280,12 +249,6 @@ class TypeChecking(BaseModel):
280
249
)
281
250
282
251
283
- class ValidationAction (Enum ):
284
- Audit = "Audit"
285
- Deny = "Deny"
286
- Warn = "Warn"
287
-
288
-
289
252
class Validation (BaseModel ):
290
253
expression : str = Field (
291
254
...,
@@ -454,7 +417,7 @@ class MatchResources(BaseModel):
454
417
" resource matches both, it is excluded)"
455
418
),
456
419
)
457
- matchPolicy : Optional [MatchPolicy ] = Field (
420
+ matchPolicy : Optional [str ] = Field (
458
421
default = None ,
459
422
description = (
460
423
'matchPolicy defines how the "MatchResources" list is used to match'
@@ -470,11 +433,7 @@ class MatchResources(BaseModel):
470
433
' extensions/v1beta1, and "rules" only included `apiGroups:["apps"],'
471
434
' apiVersions:["v1"], resources: ["deployments"]`, a request to'
472
435
" apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent"
473
- ' to the ValidatingAdmissionPolicy.\n \n Defaults to "Equivalent"\n \n Possible'
474
- ' enum values:\n - `"Equivalent"` means requests should be sent to the'
475
- " webhook if they modify a resource listed in rules via another API group"
476
- ' or version.\n - `"Exact"` means requests should only be sent to the'
477
- " webhook if they exactly match a given rule."
436
+ ' to the ValidatingAdmissionPolicy.\n \n Defaults to "Equivalent"'
478
437
),
479
438
)
480
439
namespaceSelector : Optional [v1 .LabelSelector ] = Field (
@@ -542,14 +501,11 @@ class MutatingWebhook(BaseModel):
542
501
...,
543
502
description = "ClientConfig defines how to communicate with the hook. Required" ,
544
503
)
545
- failurePolicy : Optional [FailurePolicy ] = Field (
504
+ failurePolicy : Optional [str ] = Field (
546
505
default = None ,
547
506
description = (
548
507
"FailurePolicy defines how unrecognized errors from the admission endpoint"
549
- " are handled - allowed values are Ignore or Fail. Defaults to"
550
- ' Fail.\n \n Possible enum values:\n - `"Fail"` means that an error calling'
551
- ' the webhook causes the admission to fail.\n - `"Ignore"` means that an'
552
- " error calling the webhook is ignored."
508
+ " are handled - allowed values are Ignore or Fail. Defaults to Fail."
553
509
),
554
510
)
555
511
matchConditions : Optional [List [MatchCondition ]] = Field (
@@ -567,7 +523,7 @@ class MutatingWebhook(BaseModel):
567
523
" failurePolicy=Ignore, the error is ignored and the webhook is skipped"
568
524
),
569
525
)
570
- matchPolicy : Optional [MatchPolicy ] = Field (
526
+ matchPolicy : Optional [str ] = Field (
571
527
default = None ,
572
528
description = (
573
529
'matchPolicy defines how the "rules" list is used to match incoming'
@@ -583,10 +539,7 @@ class MutatingWebhook(BaseModel):
583
539
' only included `apiGroups:["apps"], apiVersions:["v1"], resources:'
584
540
' ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would'
585
541
" be converted to apps/v1 and sent to the webhook.\n \n Defaults to"
586
- ' "Equivalent"\n \n Possible enum values:\n - `"Equivalent"` means requests'
587
- " should be sent to the webhook if they modify a resource listed in rules"
588
- ' via another API group or version.\n - `"Exact"` means requests should'
589
- " only be sent to the webhook if they exactly match a given rule."
542
+ ' "Equivalent"'
590
543
),
591
544
)
592
545
name : str = Field (
@@ -635,7 +588,7 @@ class MutatingWebhook(BaseModel):
635
588
" LabelSelector, which matches everything."
636
589
),
637
590
)
638
- reinvocationPolicy : Optional [ReinvocationPolicy ] = Field (
591
+ reinvocationPolicy : Optional [str ] = Field (
639
592
default = None ,
640
593
description = (
641
594
"reinvocationPolicy indicates whether this webhook should be called"
@@ -652,12 +605,7 @@ class MutatingWebhook(BaseModel):
652
605
" webhooks that use this option may be reordered to minimize the number of"
653
606
" additional invocations. * to validate an object after all mutations are"
654
607
" guaranteed complete, use a validating admission webhook"
655
- ' instead.\n \n Defaults to "Never".\n \n Possible enum values:\n -'
656
- ' `"IfNeeded"` indicates that the webhook may be called at least one'
657
- " additional time as part of the admission evaluation if the object being"
658
- " admitted is modified by other admission plugins after the initial webhook"
659
- ' call.\n - `"Never"` indicates that the webhook must not be called more'
660
- " than once in a single admission evaluation."
608
+ ' instead.\n \n Defaults to "Never".'
661
609
),
662
610
)
663
611
rules : Optional [List [RuleWithOperations ]] = Field (
@@ -673,7 +621,7 @@ class MutatingWebhook(BaseModel):
673
621
" MutatingWebhookConfiguration objects."
674
622
),
675
623
)
676
- sideEffects : SideEffects = Field (
624
+ sideEffects : str = Field (
677
625
...,
678
626
description = (
679
627
"SideEffects states whether this webhook has side effects. Acceptable"
@@ -682,16 +630,7 @@ class MutatingWebhook(BaseModel):
682
630
" reconciliation system, since a request may be rejected by a future step"
683
631
" in the admission chain and the side effects therefore need to be undone."
684
632
" Requests with the dryRun attribute will be auto-rejected if they match a"
685
- " webhook with sideEffects == Unknown or Some.\n \n Possible enum values:\n -"
686
- ' `"None"` means that calling the webhook will have no side effects.\n -'
687
- ' `"NoneOnDryRun"` means that calling the webhook will possibly have side'
688
- " effects, but if the request being reviewed has the dry-run attribute, the"
689
- ' side effects will be suppressed.\n - `"Some"` means that calling the'
690
- " webhook will possibly have side effects. If a request with the dry-run"
691
- " attribute would trigger a call to this webhook, the request will instead"
692
- ' fail.\n - `"Unknown"` means that no information is known about the side'
693
- " effects of calling the webhook. If a request with the dry-run attribute"
694
- " would trigger a call to this webhook, the request will instead fail."
633
+ " webhook with sideEffects == Unknown or Some."
695
634
),
696
635
)
697
636
timeoutSeconds : Optional [int ] = Field (
@@ -859,7 +798,7 @@ class ValidatingAdmissionPolicyBindingSpec(BaseModel):
859
798
" Required."
860
799
),
861
800
)
862
- validationActions : Optional [List [ValidationAction ]] = Field (
801
+ validationActions : Optional [List [str ]] = Field (
863
802
default = None ,
864
803
description = (
865
804
"validationActions declares how Validations of the referenced"
@@ -908,7 +847,7 @@ class ValidatingAdmissionPolicySpec(BaseModel):
908
847
" auditAnnotations is required."
909
848
),
910
849
)
911
- failurePolicy : Optional [FailurePolicy ] = Field (
850
+ failurePolicy : Optional [str ] = Field (
912
851
default = None ,
913
852
description = (
914
853
"failurePolicy defines how to handle failures for the admission policy."
@@ -919,10 +858,7 @@ class ValidatingAdmissionPolicySpec(BaseModel):
919
858
" non-existent resource.\n \n failurePolicy does not define how validations"
920
859
" that evaluate to false are handled.\n \n When failurePolicy is set to Fail,"
921
860
" ValidatingAdmissionPolicyBinding validationActions define how failures"
922
- " are enforced.\n \n Allowed values are Ignore or Fail. Defaults to"
923
- ' Fail.\n \n Possible enum values:\n - `"Fail"` means that an error calling'
924
- ' the webhook causes the admission to fail.\n - `"Ignore"` means that an'
925
- " error calling the webhook is ignored."
861
+ " are enforced.\n \n Allowed values are Ignore or Fail. Defaults to Fail."
926
862
),
927
863
)
928
864
matchConditions : Optional [List [MatchCondition ]] = Field (
@@ -1025,14 +961,11 @@ class ValidatingWebhook(BaseModel):
1025
961
...,
1026
962
description = "ClientConfig defines how to communicate with the hook. Required" ,
1027
963
)
1028
- failurePolicy : Optional [FailurePolicy ] = Field (
964
+ failurePolicy : Optional [str ] = Field (
1029
965
default = None ,
1030
966
description = (
1031
967
"FailurePolicy defines how unrecognized errors from the admission endpoint"
1032
- " are handled - allowed values are Ignore or Fail. Defaults to"
1033
- ' Fail.\n \n Possible enum values:\n - `"Fail"` means that an error calling'
1034
- ' the webhook causes the admission to fail.\n - `"Ignore"` means that an'
1035
- " error calling the webhook is ignored."
968
+ " are handled - allowed values are Ignore or Fail. Defaults to Fail."
1036
969
),
1037
970
)
1038
971
matchConditions : Optional [List [MatchCondition ]] = Field (
@@ -1050,7 +983,7 @@ class ValidatingWebhook(BaseModel):
1050
983
" failurePolicy=Ignore, the error is ignored and the webhook is skipped"
1051
984
),
1052
985
)
1053
- matchPolicy : Optional [MatchPolicy ] = Field (
986
+ matchPolicy : Optional [str ] = Field (
1054
987
default = None ,
1055
988
description = (
1056
989
'matchPolicy defines how the "rules" list is used to match incoming'
@@ -1066,10 +999,7 @@ class ValidatingWebhook(BaseModel):
1066
999
' only included `apiGroups:["apps"], apiVersions:["v1"], resources:'
1067
1000
' ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would'
1068
1001
" be converted to apps/v1 and sent to the webhook.\n \n Defaults to"
1069
- ' "Equivalent"\n \n Possible enum values:\n - `"Equivalent"` means requests'
1070
- " should be sent to the webhook if they modify a resource listed in rules"
1071
- ' via another API group or version.\n - `"Exact"` means requests should'
1072
- " only be sent to the webhook if they exactly match a given rule."
1002
+ ' "Equivalent"'
1073
1003
),
1074
1004
)
1075
1005
name : str = Field (
@@ -1131,7 +1061,7 @@ class ValidatingWebhook(BaseModel):
1131
1061
" MutatingWebhookConfiguration objects."
1132
1062
),
1133
1063
)
1134
- sideEffects : SideEffects = Field (
1064
+ sideEffects : str = Field (
1135
1065
...,
1136
1066
description = (
1137
1067
"SideEffects states whether this webhook has side effects. Acceptable"
@@ -1140,16 +1070,7 @@ class ValidatingWebhook(BaseModel):
1140
1070
" reconciliation system, since a request may be rejected by a future step"
1141
1071
" in the admission chain and the side effects therefore need to be undone."
1142
1072
" Requests with the dryRun attribute will be auto-rejected if they match a"
1143
- " webhook with sideEffects == Unknown or Some.\n \n Possible enum values:\n -"
1144
- ' `"None"` means that calling the webhook will have no side effects.\n -'
1145
- ' `"NoneOnDryRun"` means that calling the webhook will possibly have side'
1146
- " effects, but if the request being reviewed has the dry-run attribute, the"
1147
- ' side effects will be suppressed.\n - `"Some"` means that calling the'
1148
- " webhook will possibly have side effects. If a request with the dry-run"
1149
- " attribute would trigger a call to this webhook, the request will instead"
1150
- ' fail.\n - `"Unknown"` means that no information is known about the side'
1151
- " effects of calling the webhook. If a request with the dry-run attribute"
1152
- " would trigger a call to this webhook, the request will instead fail."
1073
+ " webhook with sideEffects == Unknown or Some."
1153
1074
),
1154
1075
)
1155
1076
timeoutSeconds : Optional [int ] = Field (
0 commit comments