Docs/CloudNative/Kubernetes/Base/创建configmap格式异常问题.md

7 lines
No EOL
340 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

可能是由于配置文件如nginx.conf文件自身存在制表符TAB或者尾随空格Kubernetes ConfigMap在load过程中发现文件中包含tab缩进直接转化为\n\t。
```shell
# 使用以下方法删除尾随空格
sed -i -E 's/[[:space:]]+$//g' file.txt
# 使用空格替换制表符
sed -i 's/\t/ /g' file.txt
```