refactor: use CallPlugnTrigger instead of PlugnTriggerOutput

Refs #6422
This commit is contained in:
Jose Diaz-Gonzalez
2024-03-14 01:18:28 -04:00
parent a9933c7f02
commit cdff4ae867
15 changed files with 149 additions and 58 deletions

View File

@@ -43,12 +43,15 @@ func BuildConfig(appName string) error {
}
appRoot := common.AppRoot(appName)
s, err := common.PlugnTriggerOutput("ps-current-scale", []string{appName}...)
results, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "ps-current-scale",
Args: []string{appName},
})
if err != nil {
return err
}
scale, err := common.ParseScaleOutput(s)
scale, err := common.ParseScaleOutput(results.StdoutBytes())
if err != nil {
return err
}
@@ -78,7 +81,10 @@ func BuildConfig(appName string) error {
ipAddress := GetContainerIpaddress(appName, processType, containerID)
if ipAddress != "" {
args := []string{appName, processType, containerIndexString, ipAddress}
_, err := common.PlugnTriggerOutput("network-write-ipaddr", args...)
_, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "network-write-ipaddr",
Args: args,
})
if err != nil {
common.LogWarn(err.Error())
}