Skip to content

Commit 6e03c85

Browse files
committed
Unqualify example override replacement types
Signed-off-by: Brendan Hay <[email protected]>
1 parent d4c1191 commit 6e03c85

File tree

1 file changed

+86
-18
lines changed

1 file changed

+86
-18
lines changed

overrides.example.yaml

Lines changed: 86 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
propertyRules:
1010
# `replacement` is a `String` that will be used verbatim as the property's Rust type,
1111
# if this rule matches.
12-
- replacement: k8s_openapi::api::core::v1::ResourceRequirements
12+
- replacement: ResourceRequirements
1313

1414
# 1. Name-directed matching.
1515
#
@@ -91,20 +91,22 @@ propertyRules:
9191
#
9292
# Generally, it is not advised to omit type-directed matching completely, since you could possibly
9393
# over-eagerly perform replacement of completely unrelated types.
94-
- replacement: k8s_openapi::api::core::v1::Affinity
94+
- replacement: Affinity
9595
matchName:
9696
- exact: affinity
97-
98-
- replacement: k8s_openapi::api::core::v1::TopologySpreadConstraint
99-
matchName:
100-
- exact: topologySpreadConstraints
101-
102-
- replacement: Vec<k8s_openapi::api::core::v1::Toleration>
103-
matchName:
104-
- exact: tolerations
97+
# matchSchema:
98+
# subset:
99+
# type: object
100+
# properties:
101+
# nodeAffinity:
102+
# type: object
103+
# podAffinity:
104+
# type: object
105+
# podAntiAffinity:
106+
# type: object
105107

106108
# You can modify all matched names with the same `replacement` type, if the `matchSchema` succeeds.
107-
- replacement: k8s_openapi::api::core::v1::Probe
109+
- replacement: Probe
108110
matchName:
109111
- exact: livenessProbe
110112
- exact: readinessProbe
@@ -131,7 +133,7 @@ propertyRules:
131133
# have the same `matchName` expressions, but differing `matchSchema` expressions.
132134

133135
# Replace the container security context.
134-
- replacement: k8s_openapi::api::core::v1::SecurityContext
136+
- replacement: SecurityContext
135137
matchName:
136138
- exact: securityContext
137139
matchSchema:
@@ -201,7 +203,7 @@ propertyRules:
201203
type: string
202204

203205
# Replace the pod security context.
204-
- replacement: k8s_openapi::api::core::v1::PodSecurityContext
206+
- replacement: PodSecurityContext
205207
matchName:
206208
- exact: securityContext
207209
matchSchema:
@@ -268,7 +270,7 @@ propertyRules:
268270
runAsUserName:
269271
type: string
270272

271-
- replacement: Vec<k8s_openapi::api::core::v1::LocalObjectReference>
273+
- replacement: Vec<LocalObjectReference>
272274
matchAnyName:
273275
- exact:
274276
matchSchema:
@@ -280,7 +282,7 @@ propertyRules:
280282
name:
281283
type: string
282284

283-
- replacement: k8s_openapi::api::core::v1::EnvVar
285+
- replacement: Vec<EnvVar>
284286
matchName:
285287
- exact: env
286288
matchSchema:
@@ -296,7 +298,7 @@ propertyRules:
296298
valueFrom:
297299
type: object
298300

299-
- replacement: k8s_openapi::api::core::v1::VolumeMount
301+
- replacement: Vec<VolumeMount>
300302
matchName:
301303
- exact: volumeMounts
302304
matchSchema:
@@ -320,9 +322,9 @@ propertyRules:
320322
subPathExpr:
321323
type: string
322324

323-
- replacement: k8s_openapi::api::core::v1::Volume
325+
- replacement: Vec<Volume>
324326
matchName:
325-
- exact: volume
327+
- exact: volumes
326328
matchSchema:
327329
subset:
328330
type: array
@@ -351,3 +353,69 @@ propertyRules:
351353
type: boolean
352354
secretName:
353355
type: string
356+
357+
- replacement: Vec<Toleration>
358+
matchName:
359+
- exact: tolerations
360+
matchSchema:
361+
exhaustive:
362+
type: array
363+
items:
364+
type: object
365+
properties:
366+
effect:
367+
type: string
368+
key:
369+
type: string
370+
operator:
371+
type: string
372+
tolerationSeconds:
373+
type: integer
374+
value:
375+
type: string
376+
377+
- replacement: TopologySpreadConstraint
378+
matchName:
379+
- exact: topologySpreadConstraints
380+
matchSchema:
381+
exhaustive:
382+
type: array
383+
items:
384+
type: object
385+
properties:
386+
labelSelector:
387+
type: object
388+
properties:
389+
matchExpressions:
390+
type: array
391+
items:
392+
type: object
393+
properties:
394+
key:
395+
type: string
396+
operator:
397+
type: string
398+
values:
399+
type: array
400+
items:
401+
type: string
402+
matchLabels:
403+
additionalProperties:
404+
type: string
405+
type: object
406+
matchLabelKeys:
407+
type: array
408+
items:
409+
type: string
410+
maxSkew:
411+
type: integer
412+
minDomains:
413+
type: integer
414+
nodeAffinityPolicy:
415+
type: string
416+
nodeTaintsPolicy:
417+
type: string
418+
topologyKey:
419+
type: string
420+
whenUnsatisfiable:
421+
type: string

0 commit comments

Comments
 (0)