More updates
This commit is contained in:
parent
dc6f24bf32
commit
ab1d643157
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
/.vs
|
/.vs
|
||||||
|
apiserver.local.config
|
||||||
|
|||||||
6
main.go
6
main.go
@ -12,6 +12,10 @@ import (
|
|||||||
"github.com/cert-manager/cert-manager/pkg/acme/webhook/cmd"
|
"github.com/cert-manager/cert-manager/pkg/acme/webhook/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
providerName = "sthome"
|
||||||
|
)
|
||||||
|
|
||||||
var GroupName = os.Getenv("GROUP_NAME")
|
var GroupName = os.Getenv("GROUP_NAME")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -74,7 +78,7 @@ type customDNSProviderConfig struct {
|
|||||||
// within a single webhook deployment**.
|
// within a single webhook deployment**.
|
||||||
// For example, `cloudflare` may be used as the name of a solver.
|
// For example, `cloudflare` may be used as the name of a solver.
|
||||||
func (c *customDNSProviderSolver) Name() string {
|
func (c *customDNSProviderSolver) Name() string {
|
||||||
return "my-custom-solver"
|
return providerName
|
||||||
}
|
}
|
||||||
|
|
||||||
// Present is responsible for actually presenting the DNS record with the
|
// Present is responsible for actually presenting the DNS record with the
|
||||||
|
|||||||
@ -10,14 +10,14 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TeststhomeSolver_Name(t *testing.T) {
|
func TestSthomeSolver_Name(t *testing.T) {
|
||||||
port, _ := rand.Int(rand.Reader, big.NewInt(50000))
|
port, _ := rand.Int(rand.Reader, big.NewInt(50000))
|
||||||
port = port.Add(port, big.NewInt(15534))
|
port = port.Add(port, big.NewInt(15534))
|
||||||
solver := New(port.String())
|
solver := New(port.String())
|
||||||
assert.Equal(t, "sthome", solver.Name())
|
assert.Equal(t, "sthome", solver.Name())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TeststhomeSolver_Initialize(t *testing.T) {
|
func TestSthomeSolver_Initialize(t *testing.T) {
|
||||||
port, _ := rand.Int(rand.Reader, big.NewInt(50000))
|
port, _ := rand.Int(rand.Reader, big.NewInt(50000))
|
||||||
port = port.Add(port, big.NewInt(15534))
|
port = port.Add(port, big.NewInt(15534))
|
||||||
solver := New(port.String())
|
solver := New(port.String())
|
||||||
@ -27,7 +27,7 @@ func TeststhomeSolver_Initialize(t *testing.T) {
|
|||||||
close(done)
|
close(done)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TeststhomeSolver_Present_Cleanup(t *testing.T) {
|
func TestSthomeSolver_Present_Cleanup(t *testing.T) {
|
||||||
port, _ := rand.Int(rand.Reader, big.NewInt(50000))
|
port, _ := rand.Int(rand.Reader, big.NewInt(50000))
|
||||||
port = port.Add(port, big.NewInt(15534))
|
port = port.Add(port, big.NewInt(15534))
|
||||||
solver := New(port.String())
|
solver := New(port.String())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user