Skip to content

Commit

Permalink
fix: suffix entry with .verify if using rootdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
bittermandel committed Mar 14, 2024
1 parent ce2c6fa commit 2489ff0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif
GO_VERSION ?= $(shell go mod edit -json | grep -${GREP_PREGEX_FLAG}o '"Go":\s+"([0-9.]+)"' | sed -E 's/.+"([0-9.]+)"/\1/')

IMAGE_NAME := molnett/cert-manager-webhook-gandi
IMAGE_TAG := 0.2.1
IMAGE_TAG := 0.2.2

OUT := $(shell pwd)/_out

Expand Down
4 changes: 2 additions & 2 deletions gandiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ func (c *GandiClient) CreateTxtRecord(domain *string, name *string, value *strin

req.Header.Set("Content-Type", "application/json")

status, _, err := c.doRequest(req, false)
status, body, err := c.doRequest(req, false)
if err != nil {
return err
}

if status != http.StatusCreated && status != http.StatusOK {
return fmt.Errorf("failed creating TXT record: %v", err)
return fmt.Errorf("failed creating TXT record: %d, %s", status, string(body))
}

return nil
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func (c *gandiDNSProviderSolver) Present(ch *v1alpha1.ChallengeRequest) error {
if cfg.RootDomain != "" {
entry = strings.TrimPrefix(ch.ResolvedFQDN, "_acme-challenge.")
entry = strings.TrimSuffix(entry, ".")
entry = strings.Replace(entry, ".", "_", -1)
entry = entry + ".verify"
domain = cfg.RootDomain
}

Expand Down

0 comments on commit 2489ff0

Please sign in to comment.