appoptics / appoptics-agent-docker

The AppOptics agent is now the SolarWinds Snap Agent! VISIT HERE: https://github.com/solarwinds/solarwinds-snap-agent-docker for the latest agent and updates.
https://github.com/solarwinds/solarwinds-snap-agent-docker
Apache License 2.0
4 stars 0 forks source link

Adjust init script to fail on errors and use exec to pass SIG(nals) down to the AO process #12

Closed cmrust closed 6 years ago

cmrust commented 6 years ago

Made these changes based on the comments in PR https://github.com/appoptics/kube-ao/pull/9

cmrust commented 6 years ago

Tested and working on Zeus đź‘Ť

alexouzounis commented 6 years ago

Lets wait for @cce to have a look and merge tomorrow :)

alexouzounis commented 6 years ago

good catch yes!

cce commented 6 years ago

That entrypoint script we use internally also includes this fancy logic for setting the log level, which may be overkill, but just mentioning it here for completeness as it's the other environment variable option it provides.

shopt -s nocasematch
case $LOG_LEVEL in
    debug) loglevel=1;;
    info) loglevel=2;;
    warn|warning) loglevel=3;;
    error) loglevel=4;;
    fatal) loglevel=5;;
    *) loglevel=3;;
esac
shopt -u nocasematch
sed -i "s/^log_level: 3/log_level: ${loglevel}/" ${CONFIG_FILE}
alexouzounis commented 6 years ago

Yes on both! I would prefer if everything becomes an env var for 12factor app compliance.

If you guys agree, let’s merge this PR and get another with your proposed changes. Many small PRs for the win

alexouzounis commented 6 years ago

Also it might be time to create a docker-aoagent repo for the Dockerfiles. Then use that for kube so specific assets as originally intended