More updates

This commit is contained in:
Chris Stuurman 2024-03-21 15:24:19 +02:00
parent dc6f24bf32
commit ab1d643157
3 changed files with 9 additions and 4 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
################################################################################
/.vs
apiserver.local.config

View File

@ -12,6 +12,10 @@ import (
"github.com/cert-manager/cert-manager/pkg/acme/webhook/cmd"
)
const (
providerName = "sthome"
)
var GroupName = os.Getenv("GROUP_NAME")
func main() {
@ -74,7 +78,7 @@ type customDNSProviderConfig struct {
// within a single webhook deployment**.
// For example, `cloudflare` may be used as the name of a solver.
func (c *customDNSProviderSolver) Name() string {
return "my-custom-solver"
return providerName
}
// Present is responsible for actually presenting the DNS record with the

View File

@ -10,14 +10,14 @@ import (
"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 = port.Add(port, big.NewInt(15534))
solver := New(port.String())
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 = port.Add(port, big.NewInt(15534))
solver := New(port.String())
@ -27,7 +27,7 @@ func TeststhomeSolver_Initialize(t *testing.T) {
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 = port.Add(port, big.NewInt(15534))
solver := New(port.String())