Skip to content

Commit

Permalink
Add kubectl patch example with quotes on Windows (kubernetes#18853)
Browse files Browse the repository at this point in the history
* Add kubectl patch example with quotes on Windows

When running the `kubectl patch` example, on Windows systems you get an
error when passing the patch request in single quotes. Passing it in
double quotes with the inner ones escaped produced the desired behavior
as is in the example given for Linux systems. I've added a small note
for Windows users to have that in mind.

Signed-off-by: Mariyan Dimitrov <[email protected]>

* Use Hugo note shortcode

Windows note is placed inside a
[shortcode](https://kubernetes.io/docs/contribute/style/style-guide/#shortcodes)
to be consistent with the style guide.

Signed-off-by: Mariyan Dimitrov <[email protected]>

* Remove shell Markdown syntax

I've removed the shell syntax from the Windows example and have changed
the description to be the same as the one used in
[jsonpath](https://kubernetes.io/docs/reference/kubectl/jsonpath/)
document to be more consistent. The jsonpath example uses cmd syntax,
though it is note inside a note shortcode, therefore I've opted out of
using any syntax as it seems to break rendering inside the shortcode.

Signed-off-by: Mariyan Dimitrov <[email protected]>

* Add cmd markdown syntax and fix order list

I've tested this locally with `make docker-serve` on my Linux machine
and finally things are looking better, I've managed to address these two
issues:

- the Windows example is now inside `note` shortcode and also the cmd
syntax renders correctly on the page

- the list of steps broke after the first one, I've indented a paragraph
and now the steps are in the expected order

Signed-off-by: Mariyan Dimitrov <[email protected]>

* Remove command prompt from example

According to the [style guide](https://kubernetes.io/docs/contribute/style/style-guide/#don-t-include-the-command-prompt), the command prompt should not be included when showing an example. This commit removes it for consistency with the style guide.

Signed-off-by: Mariyan Dimitrov <[email protected]>
  • Loading branch information
merkata authored and wawa0210 committed Mar 2, 2020
1 parent 1cfe331 commit e22bc8d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ the corresponding `PersistentVolume` is not be deleted. Instead, it is moved to
pvc-b95650f8-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim2 manual 6s
pvc-bb3ca71d-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim3 manual 3s

This list also includes the name of the claims that are bound to each volume
This list also includes the name of the claims that are bound to each volume
for easier identification of dynamically provisioned volumes.

1. Choose one of your PersistentVolumes and change its reclaim policy:
Expand All @@ -54,6 +54,15 @@ the corresponding `PersistentVolume` is not be deleted. Instead, it is moved to

where `<your-pv-name>` is the name of your chosen PersistentVolume.

{{< note >}}
On Windows, you must _double_ quote any JSONPath template that contains spaces (not single quote as shown above for bash). This in turn means that you must use a single quote or escaped double quote around any literals in the template. For example:

```cmd
kubectl patch pv <your-pv-name> -p "{\"spec\":{\"persistentVolumeReclaimPolicy\":\"Retain\"}}"
```

{{< /note >}}

1. Verify that your chosen PersistentVolume has the right policy:

```shell
Expand Down

0 comments on commit e22bc8d

Please sign in to comment.