【发布时间】:2019-04-21 03:37:45
【问题描述】:
我正在使用 Shelljs 和 sed 命令生成新的 K8S 配置文件
shell.exec(`sed -e s%${server}%${endpoint}%g -e s%${certificate}%${cert}%g config-temp`)
shell.exec("cat config-temp | tee config")
然后我通过运行检查K8S集群是否工作
kubectl cluster-info
错误信息看起来像
error: Error loading config file "~/.kube/config": yaml: control characters are not allowed
但是,如果我从config-temp 复制所有内容,然后将其粘贴到config,kubectl cluster-info 作品中。
我没有在网上找到相同的错误信息。我只是想知道是否有人遇到过类似的问题。任何帮手
【问题讨论】:
-
@EdMorton 。感谢您的输入。 sed 部分没有问题,我想我的问题还不够清楚。问题是当我用cert替换证书时,cert变量中的文本有一些特殊字符,K8S无法识别。
标签: node.js sed kubernetes shelljs