feat: add trigger to allow retrieving resource properties on the fly

This commit is contained in:
Jose Diaz-Gonzalez
2019-04-08 11:31:18 -04:00
parent 243d5ecc43
commit c2898ec040
4 changed files with 49 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
package main
import (
"flag"
"fmt"
"os"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/resource"
)
// writes the resource property to stdout for a given app container
func main() {
flag.Parse()
appName := flag.Arg(0)
procType := flag.Arg(1)
resourceType := flag.Arg(1)
property := flag.Arg(1)
value, err := resource.GetResourceValue(appName, procType, resourceType, property)
if err != nil {
common.LogFail(err.Error())
}
fmt.Fprintln(os.Stdout, value)
}