-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
35 lines (28 loc) · 836 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
35
package main
import (
"os"
"github.com/cert-manager/cert-manager/pkg/acme/webhook/cmd"
"k8s.io/klog/v2"
)
const (
nameSecret = "nicru-tokens"
apiUrl = `https://api.nic.ru/`
oauthUrl = apiUrl + `oauth/token`
urlCommit = apiUrl + `dns-master/services/%s/zones/%s/commit`
urlCreateRecord = apiUrl + `dns-master/services/%s/zones/%s/records`
urlDeleteRecord = apiUrl + `dns-master/services/%s/zones/%s/records/%s`
urlGetRecord = apiUrl + `dns-master/services/%s/zones/%s/records`
urlGetZoneInfo = apiUrl + `dns-master/zones/?token=%s`
)
var (
GroupName = os.Getenv("GROUP_NAME")
Namespace = os.Getenv("NAMESPACE")
)
func main() {
if GroupName == "" {
klog.Fatal("group name must be specified")
}
c := DNSProviderSolver{}
go c.cronUpdateToken()
cmd.RunWebhookServer(GroupName, &c)
}