Code refactoring adding support of GoDaddy Api v3 - #71
Open
cmoulliard wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the GoDaddy cert-manager DNS01 webhook to support GoDaddy Domains API v3 (including PAT/Bearer authentication), while keeping API v1 as the current default and reorganizing code into clearer internal packages with expanded unit testing and updated documentation.
Changes:
- Introduces versioned GoDaddy API clients (
internal/godaddy/v1andinternal/godaddy/v3) and PAT-based auth extraction (internal/auth), selected viaapiVersion. - Updates developer workflow: new Makefile targets for unit tests, revised envtest binary setup script, and CI workflow for build/unit tests.
- Expands documentation and testdata to cover v1/v3 configuration and testing.
Reviewed changes
Copilot reviewed 20 out of 23 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/godaddy/v3/config.json | Adds v3 solver config fixture (includes apiVersion: v3). |
| testdata/godaddy/v1/config.json | Adds v1 solver config fixture (default-style config). |
| testdata/godaddy/README.md | Removes placeholder README content. |
| scripts/fetch-test-binaries.sh | Switches envtest binary installation to setup-envtest. |
| README.md | Updates docs for v3/PAT usage, testing workflow, and project structure. |
| Makefile | Adds test-unit, test-v1, test-v3, and propagates TEST_API_VERSION. |
| main.go | Refactors solver to use internal auth/dns/godaddy clients and API version selection. |
| internal/logging/logging.go | Adds centralized logrus configuration helper. |
| internal/godaddy/v3/client.go | Adds GoDaddy API v3 client implementation. |
| internal/godaddy/v3/client_test.go | Adds unit tests for the v3 client via httptest. |
| internal/godaddy/v1/client.go | Adds GoDaddy API v1 client implementation. |
| internal/godaddy/v1/client_test.go | Adds unit tests for the v1 client via httptest. |
| internal/godaddy/types.go | Adds shared client interface/types + shared HTTP request helper. |
| internal/dns/dns.go | Extracts DNS zone/record-name helpers. |
| internal/auth/auth.go | Adds secret parsing for v1 (key:secret) and v3 (PAT) formats. |
| internal/auth/auth_test.go | Adds unit tests for secret parsing helpers. |
| dns_resolver_test.go | Adds API-version-aware manifest selection for integration/conformance test. |
| deploy/charts/godaddy-webhook/templates/pki.yaml | Minor comment wording fix (“self-signed”). |
| common/util.go | Removes unused env var helper. |
| cmd.md | Documents key make/test commands. |
| .gitignore | Ignores versioned test secret manifests. |
| .github/workflows/ci.yml | Adds CI workflow for build + unit tests. |
| .github/workflows/build-push-image-commit.yml | Modernizes and gates image build/push on CI workflow. |
Suppressed comments (4)
internal/auth/auth.go:35
- This error message formats the Secret reference as "/" instead of "/".
if len(parts) != 2 {
return nil, fmt.Errorf("secret \"%s/%s\" key %q: expected format \"apiKey:apiSecret\"", secretName, namespace, secretKey)
}
internal/auth/auth.go:56
- The error message formats the Secret reference as "/", but Kubernetes convention is "/".
if !ok {
return "", fmt.Errorf("key %q not found in secret \"%s/%s\"", secretKey, secretName, namespace)
}
internal/auth/auth.go:61
- This error message formats the Secret reference as "/" instead of "/".
if token == "" {
return "", fmt.Errorf("secret \"%s/%s\" key %q: token is empty", secretName, namespace, secretKey)
}
dns_resolver_test.go:32
- The test log prints
apiVersion(which may be empty) even thoughversionis defaulted to v1. This can lead to misleading logs whenTEST_API_VERSIONis unset.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cmoulliard
force-pushed
the
use-godaddy-api-v3
branch
3 times, most recently
from
August 19, 2026 16:57
209d004 to
b9438aa
Compare
Test image ready
To test on a kind cluster: # Pull, save, and load into kind
podman pull quay.io/snowdrop/cert-manager-webhook-godaddy:pr-71
podman save quay.io/snowdrop/cert-manager-webhook-godaddy:pr-71 -o /tmp/webhook-pr.tar
kind load image-archive /tmp/webhook-pr.tar --name cert-manager-test
rm /tmp/webhook-pr.tar
# Install or upgrade the webhook
helm upgrade --install -n cert-manager godaddy-webhook ./deploy/charts/godaddy-webhook \
--set groupName=\$DOMAIN \
--set image.tag=pr-71 \
--set image.pullPolicy=Never |
Add a v3 client that uses the new GoDaddy API v3 endpoints with Bearer
token (PAT) authentication. The v3 API uses per-record CRUD operations
(/v3/domains/zones/{zone}/dns-records) with records listed under "items"
and identified by "recordId" in the response envelope.
Also includes:
- Configurable TEST_TIMEOUT for DNS propagation tests
- CI workflow to build and publish PR images for testing
- How-to guide for local kind cluster deployment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cmoulliard
force-pushed
the
use-godaddy-api-v3
branch
from
August 19, 2026 19:22
b9438aa to
edcec54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#63 #70