-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
44 lines (35 loc) · 990 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
36
37
38
39
40
41
42
43
44
package main
import (
"log"
"os"
acme "github.com/cert-manager/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1"
"github.com/cert-manager/cert-manager/pkg/acme/webhook/cmd"
"k8s.io/client-go/rest"
)
var GroupName = os.Getenv("GROUP_NAME")
func main() {
cmd.RunWebhookServer(GroupName,
&exampleSolver{
name: "pinax-webhook-solver",
},
)
}
type exampleSolver struct {
name string
}
func (e *exampleSolver) Name() string {
return e.name
}
func (e *exampleSolver) Present(ch *acme.ChallengeRequest) error {
// Log that a challenge is being requested, but don't take any action
log.Println("Presenting DNS challenge, but passing to k8s_gateway")
return nil
}
func (e *exampleSolver) CleanUp(ch *acme.ChallengeRequest) error {
log.Println("Cleaning up DNS challenge, but passing to k8s_gateway")
return nil
}
func (e *exampleSolver) Initialize(kubeClientConfig *rest.Config, stopCh <-chan struct{}) error {
log.Println("Initialize, doing nothing...")
return nil
}