-
Notifications
You must be signed in to change notification settings - Fork 149
/
main.go
34 lines (28 loc) · 945 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import (
"fmt"
"os"
"github.com/argoproj/notifications-engine/pkg/api"
"github.com/argoproj/notifications-engine/pkg/cmd"
"github.com/argoproj/notifications-engine/pkg/services"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)
func main() {
command := cmd.NewToolsCommand("cli", "cli", schema.GroupVersionResource{
Group: "cert-manager.io", Version: "v1", Resource: "certificates",
}, api.Settings{
ConfigMapName: "cert-manager-notifications-cm",
SecretName: "cert-manager-notifications-secret",
InitGetVars: func(cfg *api.Config, configMap *v1.ConfigMap, secret *v1.Secret) (api.GetVars, error) {
return func(obj map[string]interface{}, dest services.Destination) map[string]interface{} {
return map[string]interface{}{"cert": obj}
}, nil
},
})
if err := command.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}