Closed displague closed 3 years ago
This depends on the configmap:
The following 'works':
apiVersion: v1
kind: ConfigMap
metadata:
name: foo
namespace: default
data:
foo: |
#!/bin/sh
echo Hey There
"Content-Type: multipart/mixed; boundary=\"MIMEBOUNDARY\"\nMIME-Version:
1.0\r\n\r\n--MIMEBOUNDARY\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type:
text/x-shellscript\r\nMime-Version: 1.0\r\n\r\n#!/bin/sh\necho Hey There\n\r\n--MIMEBOUNDARY
However, this does not "work":
apiVersion: v1
kind: ConfigMap
metadata:
name: foo
namespace: default
data:
foo: "#!/bin/sh"
The configmap data renders as:
"Content-Type: multipart/mixed; boundary=\"MIMEBOUNDARY\"\nMIME-Version:
1.0\r\n\r\n--MIMEBOUNDARY\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type:
text/x-shellscript\r\nMime-Version: 1.0\r\n\r\n#!/bin/sh\r\n--MIMEBOUNDARY
https://groups.google.com/g/comp.lang.python/c/w5dYWUDHLvY/m/6S_bFnouzzMJ - \r
is not known to the kernel (of various OSes), so shebangs validators (such as https://github.com/packethost/userdata-rb/blob/master/lib/cloudinit_userdata/formats/shell_script.rb#L7) should not accept them.
Closing this as will not fix. Include a newline as a work-around.
Carriage-return is not valid in the first line of shebang scripts.
Configmaps read in through
parts
include carriage-returns.If this is not a bug, provide documentation that shows how to ingest a shebang script as a confimap part.