Skip to content

Commit b4abd5a

Browse files
authored
Merge pull request #42140 from KKtheGhost/sync/configuration_overview
[zh] sync concepts/configuration/overview.md
2 parents 2377c69 + 4134837 commit b4abd5a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

content/zh-cn/docs/concepts/configuration/overview.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,39 @@ to others, please don't hesitate to file an issue or submit a PR.
7878
-->
7979
- 将对象描述放在注释中,以便更好地进行内省。
8080

81+
{{< note >}}
82+
<!--
83+
There is a breaking change introduced in the [YAML 1.2](https://yaml.org/spec/1.2.0/#id2602744)
84+
boolean values specification with respect to [YAML 1.1](https://yaml.org/spec/1.1/#id864510).
85+
This is a known [issue](https://github.com/kubernetes/kubernetes/issues/34146) in Kubernetes.
86+
YAML 1.2 only recognizes **true** and **false** as valid booleans, while YAML 1.1 also accepts
87+
**yes**, **no**, **on**, and **off** as booleans. However, Kubernetes uses YAML
88+
[parsers](https://github.com/kubernetes/kubernetes/issues/34146#issuecomment-252692024) that are
89+
mostly compatible with YAML 1.1, which means that using **yes** or **no** instead of **true** or
90+
**false** in a YAML manifest may cause unexpected errors or behaviors. To avoid this issue, it is
91+
recommended to always use **true** or **false** for boolean values in YAML manifests, and to quote
92+
any strings that may be confused with booleans, such as **"yes"** or **"no"**.
93+
-->
94+
相较于 [YAML 1.1](https://yaml.org/spec/1.1/#id864510)
95+
[YAML 1.2](https://yaml.org/spec/1.2.0/#id2602744) 在布尔值规范中引入了一个破坏性的变更。
96+
这是 Kubernetes 中的一个已知[问题](https://github.com/kubernetes/kubernetes/issues/34146)
97+
YAML 1.2 仅识别 **true****false** 作为有效的布尔值,而 YAML 1.1 还可以接受
98+
**yes****no****on****off** 作为布尔值。
99+
然而,Kubernetes 正在使用的 YAML [解析器](https://github.com/kubernetes/kubernetes/issues/34146#issuecomment-252692024)
100+
与 YAML 1.1 基本兼容,
101+
这意味着在 YAML 清单中使用 **yes****no** 而不是 **true****false** 可能会导致意外的错误或行为。
102+
为避免此类问题,建议在 YAML 清单中始终使用 **true****false** 作为布尔值,
103+
并对任何可能与布尔值混淆的字符串进行引号标记,例如 **"yes"****"no"**
104+
105+
<!--
106+
Besides booleans, there are additional specifications changes between YAML versions. Please refer
107+
to the [YAML Specification Changes](https://spec.yaml.io/main/spec/1.2.2/ext/changes) documentation
108+
for a comprehensive list.
109+
-->
110+
除了布尔值之外,YAML 版本之间还存在其他的规范变化。
111+
请参考 [YAML 规范变更](https://spec.yaml.io/main/spec/1.2.2/ext/changes)文档来获取完整列表。
112+
{{< /note >}}
113+
81114
<!--
82115
## "Naked" Pods versus ReplicaSets, Deployments, and Jobs {#naked-pods-vs-replicasets-deployments-and-jobs}
83116
-->

0 commit comments

Comments
 (0)