Skip to content

Commit 1096f1f

Browse files
authored
Merge pull request #33270 from kinzhi/kinzhi46
[zh]Update content/zh/docs/tasks/configmap-secret/managing-secret-using-kubectl.md
2 parents 41dfc83 + d9a0e41 commit 1096f1f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

content/zh/docs/tasks/configmap-secret/managing-secret-using-kubectl.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ Now you can decode the `password` data:
184184
现在你可以解码 `password` 的数据:
185185

186186
```shell
187+
# 这是一个用于文档说明的示例。
188+
# 如果你这样做,数据 'MWYyZDFlMmU2N2Rm' 可以存储在你的 shell 历史中。
189+
# 可以进入你电脑的人可以找到那个记住的命令并可以在你不知情的情况下 base-64 解码这个 Secret。
190+
# 通常最好将这些步骤结合起来,如页面后面所示。
187191
echo 'MWYyZDFlMmU2N2Rm' | base64 --decode
188192
```
189193

@@ -194,6 +198,21 @@ echo 'MWYyZDFlMmU2N2Rm' | base64 --decode
194198
1f2d1e2e67df
195199
```
196200

201+
<!--
202+
In order to avoid storing a secret encoded value in your shell history, you can
203+
run the following command:
204+
-->
205+
为了避免在 shell 历史记录中存储 Secret 的编码值,可以执行如下命令:
206+
207+
```shell
208+
kubectl get secret db-user-pass -o jsonpath='{.data.password}' | base64 --decode
209+
```
210+
211+
<!--
212+
The output shall be similar as above.
213+
-->
214+
输出应与上述类似。
215+
197216
<!-- ## Clean Up -->
198217
## 清理 {#clean-up}
199218

0 commit comments

Comments
 (0)