@@ -144,21 +144,24 @@ struct has a `patchStrategy` of `merge`:
144
144
type PodSpec struct {
145
145
...
146
146
Containers []Container ` json:"containers" patchStrategy:"merge" patchMergeKey:"name" ...`
147
+ ...
148
+ }
147
149
```
148
150
149
151
You can also see the patch strategy in the
150
152
[ OpenApi spec] ( https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json ) :
151
153
152
- ` ` ` json
154
+ ``` yaml
153
155
" io.k8s.api.core.v1.PodSpec " : {
154
- ...
155
- " containers" : {
156
- " description" : " List of containers belonging to the pod. ...
157
- },
158
- " x-kubernetes-patch-merge-key" : " name" ,
159
- " x-kubernetes-patch-strategy" : " merge"
160
- },
156
+ ...,
157
+ " containers " : {
158
+ " description " : " List of containers belonging to the pod. .... "
159
+ },
160
+ " x-kubernetes-patch-merge-key " : " name" ,
161
+ " x-kubernetes-patch-strategy " : " merge"
162
+ }
161
163
```
164
+ <!-- for editors: intionally use yaml instead of json here, to prevent syntax highlight error. -->
162
165
163
166
And you can see the patch strategy in the
164
167
[ Kubernetes API documentation] (/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core).
@@ -204,6 +207,8 @@ strategic merge patch uses the default patch strategy, which is `replace`.
204
207
type PodSpec struct {
205
208
...
206
209
Tolerations []Toleration ` json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`
210
+ ...
211
+ }
207
212
```
208
213
209
214
## Use a JSON merge patch to update a Deployment
@@ -365,19 +370,24 @@ type DeploymentSpec struct {
365
370
...
366
371
// +patchStrategy=retainKeys
367
372
Strategy DeploymentStrategy ` json:"strategy,omitempty" patchStrategy:"retainKeys" ...`
373
+ ...
374
+ }
368
375
```
369
376
370
377
You can also see the ` retainKeys ` strategy in the [ OpenApi spec] ( https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json ) :
371
378
372
- ```json
379
+ ``` yaml
373
380
" io.k8s.api.apps.v1.DeploymentSpec " : {
374
- ...
375
- "strategy": {
376
- "$ref": "#/definitions/io.k8s.api.apps.v1.DeploymentStrategy",
377
- "description": "The deployment strategy to use to replace existing pods with new ones.",
378
- "x-kubernetes-patch-strategy": "retainKeys"
379
- },
381
+ ...,
382
+ " strategy " : {
383
+ " $ref " : " #/definitions/io.k8s.api.apps.v1.DeploymentStrategy" ,
384
+ " description " : " The deployment strategy to use to replace existing pods with new ones." ,
385
+ " x-kubernetes-patch-strategy " : " retainKeys"
386
+ },
387
+ ....
388
+ }
380
389
```
390
+ <!-- for editors: intionally use yaml instead of json here, to prevent syntax highlight error. -->
381
391
382
392
And you can see the ` retainKeys ` strategy in the
383
393
[ Kubernetes API documentation] (/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#deploymentspec-v1-apps).
0 commit comments