summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Godding Boye <egboye@gmail.com>2026-06-07 22:23:20 +0200
committerErik Godding Boye <egboye@gmail.com>2026-06-07 22:23:20 +0200
commitbecbcff749c0be33225c6c18837a31b41a5f4f6a (patch)
treec464a0e7008d78e7cdea04b5e00e3a22c4a833dc
parente4a6e15cc3b49ea41d6a2cf94881d7e83219ab3c (diff)
downloadcert-manager-webhook-hostinger-becbcff749c0be33225c6c18837a31b41a5f4f6a.tar.gz
cert-manager-webhook-hostinger-becbcff749c0be33225c6c18837a31b41a5f4f6a.zip
Fix new linter violations
Signed-off-by: Erik Godding Boye <egboye@gmail.com>
-rw-r--r--example/dns.go7
-rw-r--r--example/example_test.go4
-rw-r--r--main_test.go5
3 files changed, 8 insertions, 8 deletions
diff --git a/example/dns.go b/example/dns.go
index e29597e..3d01839 100644
--- a/example/dns.go
+++ b/example/dns.go
@@ -2,6 +2,7 @@ package example
import (
"fmt"
+ "log/slog"
"github.com/miekg/dns"
)
@@ -18,7 +19,11 @@ func (e *exampleSolver) handleDNSRequest(w dns.ResponseWriter, req *dns.Msg) {
}
}
}
- w.WriteMsg(msg)
+ if err := w.WriteMsg(msg); err != nil {
+ slog.Error("failed to write DNS response",
+ "error", err,
+ )
+ }
}
func (e *exampleSolver) addDNSAnswer(q dns.Question, msg *dns.Msg, req *dns.Msg) error {
diff --git a/example/example_test.go b/example/example_test.go
index ef4dde3..76796b4 100644
--- a/example/example_test.go
+++ b/example/example_test.go
@@ -59,7 +59,7 @@ func TestExampleSolver_Present_Cleanup(t *testing.T) {
msg.Id = dns.Id()
msg.RecursionDesired = true
msg.Question = make([]dns.Question, 1)
- msg.Question[0] = dns.Question{dns.Fqdn(test.hostname), dns.TypeTXT, dns.ClassINET}
+ msg.Question[0] = dns.Question{Name: dns.Fqdn(test.hostname), Qtype: dns.TypeTXT, Qclass: dns.ClassINET}
in, err := dns.Exchange(msg, "127.0.0.1:"+port.String())
assert.NoError(t, err, "Presented record %s not resolvable", test.hostname)
@@ -84,7 +84,7 @@ func TestExampleSolver_Present_Cleanup(t *testing.T) {
msg.Id = dns.Id()
msg.RecursionDesired = true
msg.Question = make([]dns.Question, 1)
- msg.Question[0] = dns.Question{dns.Fqdn(test.hostname), dns.TypeTXT, dns.ClassINET}
+ msg.Question[0] = dns.Question{Name: dns.Fqdn(test.hostname), Qtype: dns.TypeTXT, Qclass: dns.ClassINET}
in, err := dns.Exchange(msg, "127.0.0.1:"+port.String())
assert.NoError(t, err, "Presented record %s not resolvable", test.hostname)
diff --git a/main_test.go b/main_test.go
index 1d7d5ff..cd28aec 100644
--- a/main_test.go
+++ b/main_test.go
@@ -1,7 +1,6 @@
package main
import (
- "os"
"testing"
acmetest "github.com/cert-manager/cert-manager/test/acme"
@@ -9,10 +8,6 @@ import (
"github.com/cert-manager/webhook-example/example"
)
-var (
- zone = os.Getenv("TEST_ZONE_NAME")
-)
-
func TestRunsSuite(t *testing.T) {
// The manifest path should contain a file named config.json that is a
// snippet of valid configuration that should be included on the