aws / ec2-macos-init

EC2 macOS Init is the launch daemon used to initialize Mac instances within EC2.
https://aws.amazon.com/ec2/instance-types/mac/
Apache License 2.0
150 stars 19 forks source link

Misleading error classification #43

Open jahkeup opened 1 year ago

jahkeup commented 1 year ago

When userdata exits with an error, the error handling checks output and tries to classify the error to print out some helpful message (with content type).

This message is confusing when scripts themselves run into issues that "grok" as exec format errors (intended to help determine issues with the provided userdata script itself, not from errors in the userdata script's execution).

Concerned line:

https://github.com/aws/ec2-macos-init/blob/97875d5249a9b376d86cb263d2687c6dba03b38d/lib/ec2macosinit/userdata.go#L54

Instead, we should only print the helpful message when the userdata itself is found to be an unsuitable format.