refactor: use CallPlugnTrigger instead of PlugnTriggerOutputAsString

Refs #6422
This commit is contained in:
Jose Diaz-Gonzalez committed 2024-03-14 00:46:55 -04:00
1 parent a9933c7f02
commit f34fd277b3
5 files changed
+81 -26

No files matched your search

+5 -2
View File
@@ -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
}