I am using the Shelljs and sed command to generate the new K8S config file
shell.exec(`sed -e s%${server}%${endpoint}%g -e s%${certificate}%${cert}%g config-temp`)
shell.exec("cat config-temp | tee config")
Then I am checking if the K8S cluster is working by running
kubectl cluster-info
The error message looks like
error: Error loading config file "~/.kube/config": yaml: control characters are not allowed
However, if I copy all the content from the config-temp
, then paste it into the config
, kubectl cluster-info
works.
I haven't found same error messages above online. I am just wondering if anyone come across the similar issue. Any helpers