Skip to content

dns: Move DNSResponsePolicy to identity and refs pattern#9709

Merged
justinsb merged 1 commit into
GoogleCloudPlatform:masterfrom
codebot-robot:issue_9707
Jun 11, 2026
Merged

dns: Move DNSResponsePolicy to identity and refs pattern#9709
justinsb merged 1 commit into
GoogleCloudPlatform:masterfrom
codebot-robot:issue_9707

Conversation

@codebot-robot

Copy link
Copy Markdown
Collaborator

This PR migrates DNSResponsePolicy to use the modern identity.IdentityV2 and refs.Ref patterns, supporting both primary (location-based) and fallback (location-less) URL templates.

Key Changes:

  • Fallback Template Format: Configured DNSResponsePolicyIdentity with both DNSResponsePolicyIdentityFormat (projects/{project}/locations/{location}/responsePolicies/{responsePolicy}) and DNSResponsePolicyIdentityFallbackFormat (projects/{project}/responsePolicies/{responsePolicy}). This allows KCC to successfully parse standard location-less GCP response policy URLs.
  • Unit Tests: Updated apis/dns/v1alpha1/dnsresponsepolicy_identity_test.go to assert correct parsing of standard GCP response policy URLs (without location).
  • CAI Exceptions: Registered the fallback format //dns.googleapis.com/projects/{}/responsePolicies/{} in pkg/gcpurls/registry_test.go to maintain registry alignment tests.
  • Migration Journal: Added transition journal entry in .gemini/skills/kcc-identity-reference/journal/DNSResponsePolicy.md.

Fixes #9707

This PR migrates DNSResponsePolicy to use the modern `identity.IdentityV2` and `refs.Ref` patterns with support for both primary (location-based) and fallback (location-less) URL templates.

Key changes:
- Refactored `apis/dns/v1alpha1/dnsresponsepolicy_identity.go` to use both primary and fallback `gcpurls.Template` formats, allowing standard location-less GCP response policy URLs to be parsed successfully.
- Updated `apis/dns/v1alpha1/dnsresponsepolicy_identity_test.go` unit tests to assert that without-location format is correctly parsed.
- Registered the fallback format as an exception in `pkg/gcpurls/registry_test.go` to maintain CAI registry alignment.
- Created transition journal entry in `.gemini/skills/kcc-identity-reference/journal/DNSResponsePolicy.md`.

Fixes GoogleCloudPlatform#9707
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@justinsb justinsb added this pull request to the merge queue Jun 11, 2026
Merged via the queue into GoogleCloudPlatform:master with commit 2da7cd6 Jun 11, 2026
345 of 346 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move DNSResponsePolicy to identity and refs pattern

2 participants