refactor: use CallPlugnTrigger instead of PlugnTriggerOutputAsString
Refs #6422
This commit is contained in:
1 parent
a9933c7f02
commit
f34fd277b3
5 files changed
+81
-26
No files matched your search
@@ -29,12 +29,15 @@ func getPortMaps(appName string) (map[string]PortMap, error) {
|
||||
portMaps := []PortMap{}
|
||||
|
||||
allowedMappings := map[string]PortMap{}
|
||||
output, err := common.PlugnTriggerOutputAsString("ports-get", []string{appName, "json"}...)
|
||||
results, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
|
||||
Trigger: "ports-get",
|
||||
Args: []string{appName, "json"},
|
||||
})
|
||||
if err != nil {
|
||||
return allowedMappings, err
|
||||
}
|
||||
|
||||
err = json.Unmarshal([]byte(output), &portMaps)
|
||||
err = json.Unmarshal([]byte(results.StdoutContents()), &portMaps)
|
||||
if err != nil {
|
||||
return allowedMappings, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user