After spending DAYS trying to get a 25 line ruby asset to work to no avail, I rewrote the damn thing in go.
My go binary works standalone, I’m not sure it’s going to pass the whole bonsai build process at this point because I had to make some mods to the upstream plivo-go package that it uses, so for now it just builds locally. I packaged it up as an “asset” and uploaded it to my github.
type: Asset
api_version: core/v2
metadata:
name: sensu-go-plivo-handler
namespace: default
annotations:
project_url: https://github.com/bmcgair/sensu-go-plivo-handler
version: 0.0.1
spec:
url: https://github.com/bmcgair/sensu-go-plivo-handler/releases/download/0.0.1/sensu-go-plivo-handler-0.0.1.tar.gz
sha512: a7074d667a93b53fc30dafb1c68db2fa682c5a761f6ac2b65daef8c0b92a716969f7855c5cb50fa3a7ed8f793b732dc41ba9a1a6a784b4afc2efc618658c5502
When I try to use it all I see is:
{"assets":["sensu-go-plivo-handler"],"component":"pipelined","handler":"plivo","level":"info","msg":"event pipe handler executed","namespace":"default","output":"sh: sensu-go-plivo-handler: not found\n","status":127,"time":"2020-01-26T18:15:45Z"}
**strong text**
If I look on the container img itself it appears that my asset mounts, but my binary (which works elsewhere) just does this:
/var/cache/sensu/sensu-backend/a7074d667a93b53fc30dafb1c68db2fa682c5a761f6ac2b65daef8c0b92a716969f7855c5cb50fa3a7ed8f793b732dc41ba9a1a6a784b4afc2efc618658c5502/bin # pwd; ls -al
/var/cache/sensu/sensu-backend/a7074d667a93b53fc30dafb1c68db2fa682c5a761f6ac2b65daef8c0b92a716969f7855c5cb50fa3a7ed8f793b732dc41ba9a1a6a784b4afc2efc618658c5502/bin
total 24628
drwxr-xr-x 2 root root 4096 Jan 26 18:14 .
drwxr-xr-x 4 root root 4096 Jan 26 18:14 ..
-rwxrwxr-x 1 root root 25209503 Jan 26 18:14 sensu-go-plivo-handler
/var/cache/sensu/sensu-backend/a7074d667a93b53fc30dafb1c68db2fa682c5a761f6ac2b65daef8c0b92a716969f7855c5cb50fa3a7ed8f793b732dc41ba9a1a6a784b4afc2efc618658c5502/bin # ./sensu-go-plivo-handler
sh: ./sensu-go-plivo-handler: not found