Implement --userdata flag and follow the EC2 style for user data.
When resolving the flag, check if:
- starts with a shebang like string, if yes, assume it's an inline command, embed the execution into the
vminit service
- if no shebang:
- check if value starts with
http:// or https://, if so, vminit will download and execute a remote program
- check if the value is a host local path, require a specific path prefix and use
filepath.Clean to make sure no host secret data can be put in the VM, read the file and put on the VM, vminit to execute the command
- if none of the above, put the data as-is at a specific location in the VM,
vminit will do nothing
Implement
--userdataflag and follow the EC2 style for user data.When resolving the flag, check if:
vminitservicehttp://orhttps://, if so,vminitwill download and execute a remote programfilepath.Cleanto make sure no host secret data can be put in the VM, read the file and put on the VM,vminitto execute the commandvminitwill do nothing