Skip to content

Commit 5d59e10

Browse files
committed
the retainKeys strategy only works in the strategic merge patch
Signed-off-by: Iceber Gu <[email protected]>
1 parent 79afafe commit 5d59e10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/en/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ spec:
304304
Patch your Deployment:
305305
306306
```shell
307-
kubectl patch deployment retainkeys-demo --type merge --patch-file patch-file-no-retainkeys.yaml
307+
kubectl patch deployment retainkeys-demo --type strategic --patch-file patch-file-no-retainkeys.yaml
308308
```
309309
310310
In the output, you can see that it is not possible to set `type` as `Recreate` when a value is defined for `spec.strategy.rollingUpdate`:
@@ -330,7 +330,7 @@ With this patch, we indicate that we want to retain only the `type` key of the `
330330
Patch your Deployment again with this new patch:
331331
332332
```shell
333-
kubectl patch deployment retainkeys-demo --type merge --patch-file patch-file-retainkeys.yaml
333+
kubectl patch deployment retainkeys-demo --type strategic --patch-file patch-file-retainkeys.yaml
334334
```
335335
336336
Examine the content of the Deployment:

0 commit comments

Comments
 (0)