Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit 7eaedf2

Browse files
fix: call repo function failed for cli (#252)
Signed-off-by: Ryota Sakamoto <[email protected]>
1 parent 68bfe87 commit 7eaedf2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/tools/template.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/spf13/cobra"
1010

11+
"github.com/argoproj-labs/argocd-notifications/expr"
1112
"github.com/argoproj-labs/argocd-notifications/pkg/services"
1213
"github.com/argoproj-labs/argocd-notifications/pkg/util/misc"
1314
"github.com/argoproj-labs/argocd-notifications/shared/legacy"
@@ -69,7 +70,10 @@ argocd-notifications template notify app-sync-succeeded guestbook
6970
if len(parts) > 1 {
7071
dest.Recipient = parts[1]
7172
}
72-
vars := map[string]interface{}{"app": app.Object, "context": legacy.InjectLegacyVar(config.Context, dest.Service)}
73+
vars := expr.Spawn(app, cmdContext.argocdService, map[string]interface{}{
74+
"app": app.Object,
75+
"context": legacy.InjectLegacyVar(config.Context, dest.Service),
76+
})
7377
if err := config.API.Send(vars, []string{name}, dest); err != nil {
7478
_, _ = fmt.Fprintf(cmdContext.stderr, "failed to notify '%s': %v\n", recipient, err)
7579
return nil

0 commit comments

Comments
 (0)