Skip to content

feat: add v1 DomainMapping API (promote from beta to GA)#16565

Closed
Ankitsinghsisodya wants to merge 1 commit intoknative:mainfrom
Ankitsinghsisodya:feat/domainmapping-v1-ga
Closed

feat: add v1 DomainMapping API (promote from beta to GA)#16565
Ankitsinghsisodya wants to merge 1 commit intoknative:mainfrom
Ankitsinghsisodya:feat/domainmapping-v1-ga

Conversation

@Ankitsinghsisodya
Copy link
Copy Markdown
Contributor

@Ankitsinghsisodya Ankitsinghsisodya commented Apr 21, 2026

Summary

  • Adds v1 DomainMapping API types (types, lifecycle, defaults, validation, conversion) to promote DomainMapping from Beta to GA
  • Updates the reconciler, controller, and webhook to use v1 as the primary DomainMapping version
  • Keeps v1beta1 served (non-storage) for backward compatibility, with a v1beta1↔v1 conversion
  • Updates generated code: clientset, informers, listers, injection reconciler for serving:v1
  • Updates CRD to make v1 the storage version and v1beta1 still served
  • Updates e2e/conformance tests to use v1 DomainMapping

Fixes #13967

Notes

  • v1 is the conversion hub; v1beta1.ConvertTo/ConvertFrom performs the field mapping
  • The issue is currently lifecycle/frozen due to unresolved protocol issues (Websockets do not work with domainmapings by default #13083). This PR implements the API promotion work and can be evaluated once those blockers are resolved.
  • The hack/update-codegen.sh script would re-generate the injection/clientset files; the generated files here were written manually following existing patterns to maintain consistency

Test plan

  • go build ./... passes
  • go test ./pkg/... passes (all 46 modified/created files build and tests pass)
  • Unit tests added for v1 DomainMapping lifecycle, defaults, types, validation
  • E2e tests require a running cluster with DomainMapping feature enabled

Adds v1 DomainMapping API types, promotes the reconciler and webhook
to use v1 as the primary version, and keeps v1beta1 served (but no
longer the storage version) for backward compatibility.

Changes:
- Add v1 DomainMapping types, lifecycle, defaults, validation, conversion
- Add v1beta1 → v1 conversion (v1 is hub)
- Update generated clientset, informers, listers, injection for v1
- Update domainmapping reconciler/controller to use v1
- Update CRD to serve both v1 (storage) and v1beta1 (non-storage)
- Register v1 DomainMapping in webhook
- Update e2e/conformance tests to use v1

Partially addresses knative#13967
Copilot AI review requested due to automatic review settings April 21, 2026 23:11
@knative-prow knative-prow Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 21, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Apr 21, 2026

Hi @Ankitsinghsisodya. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@knative-prow knative-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 21, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Apr 21, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ankitsinghsisodya
Once this PR has been reviewed and has the lgtm label, please assign dprotaso for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@knative-prow knative-prow Bot requested review from dprotaso and skonto April 21, 2026 23:12
@Ankitsinghsisodya Ankitsinghsisodya marked this pull request as draft April 21, 2026 23:13
@knative-prow knative-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Promotes DomainMapping API to GA by introducing serving.knative.dev/v1 DomainMapping types and moving controllers/reconcilers/tests to use v1 as the primary version while keeping v1beta1 served via conversion for backward compatibility.

Changes:

  • Add v1 DomainMapping API surface (types/defaulting/validation/lifecycle) plus v1beta1↔v1 conversion.
  • Update domainmapping reconciler/controller/webhook and related resources/helpers to use v1 DomainMapping.
  • Add/update generated (or manually-aligned) clientset/informers/listers/injection reconciler for serving/v1 DomainMapping and update CRD storage version to v1.

Reviewed changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/e2e/externaldomaintls/domain_mapping_test.go Switch e2e external domain TLS DomainMapping usage to v1.
test/e2e/domainmapping/domain_mapping_websocket_test.go Switch websocket e2e DomainMapping usage to v1.
test/e2e/domainmapping/domain_mapping_test.go Switch domainmapping e2e test DomainMapping usage to v1 (incl. TLS SecretTLS type).
test/conformance/api/v1beta1/domain_mapping_test.go Update conformance test to create/read v1 DomainMapping while keeping test location.
test/clients.go Route test DomainMappings client to ServingV1() typed client.
pkg/reconciler/testing/v1/listers.go Update reconciler testing listers to use v1 DomainMapping lister.
pkg/reconciler/domainmapping/table_test.go Update domainmapping reconciler table tests to use v1 DomainMapping types and reconciler injection path.
pkg/reconciler/domainmapping/resources/ingress_test.go Update ingress resource unit tests to v1 DomainMapping types.
pkg/reconciler/domainmapping/resources/ingress.go Update MakeIngress to accept v1 DomainMapping.
pkg/reconciler/domainmapping/resources/domainclaim_test.go Update domainclaim resource unit test to v1 DomainMapping type.
pkg/reconciler/domainmapping/resources/domainclaim.go Update MakeDomainClaim to accept v1 DomainMapping.
pkg/reconciler/domainmapping/resources/certificate_test.go Update certificate resource unit tests to v1 DomainMapping types.
pkg/reconciler/domainmapping/resources/certificate.go Update MakeCertificate to accept v1 DomainMapping.
pkg/reconciler/domainmapping/reconciler.go Switch reconciler interfaces/methods from v1beta1 DomainMapping to v1 DomainMapping.
pkg/reconciler/domainmapping/controller.go Switch controller wiring/filtering to v1 DomainMapping informer/reconciler.
pkg/client/listers/serving/v1/expansion_generated.go Add DomainMapping lister expansion hooks for v1.
pkg/client/listers/serving/v1/domainmapping.go Add v1 DomainMapping lister.
pkg/client/injection/reconciler/serving/v1/domainmapping/state.go Add generated typed injection reconciler state for v1 DomainMapping.
pkg/client/injection/reconciler/serving/v1/domainmapping/reconciler.go Add generated typed injection reconciler implementation for v1 DomainMapping.
pkg/client/injection/reconciler/serving/v1/domainmapping/controller.go Add generated typed injection reconciler controller wiring for v1 DomainMapping.
pkg/client/injection/informers/serving/v1/domainmapping/filtered/fake/fake.go Add filtered fake informer injection for v1 DomainMapping.
pkg/client/injection/informers/serving/v1/domainmapping/filtered/domainmapping.go Add filtered informer injection plumbing for v1 DomainMapping.
pkg/client/injection/informers/serving/v1/domainmapping/fake/fake.go Add fake informer injection for v1 DomainMapping.
pkg/client/injection/informers/serving/v1/domainmapping/domainmapping.go Add informer injection for v1 DomainMapping.
pkg/client/informers/externalversions/serving/v1/interface.go Add DomainMappings informer accessor to serving/v1 informer interface.
pkg/client/informers/externalversions/serving/v1/domainmapping.go Add externalversions informer for v1 DomainMapping.
pkg/client/informers/externalversions/generic.go Register v1 DomainMappings in generic informer factory routing.
pkg/client/clientset/versioned/typed/serving/v1/serving_client.go Add DomainMappings getter to the typed ServingV1 client.
pkg/client/clientset/versioned/typed/serving/v1/generated_expansion.go Add DomainMappingExpansion hook.
pkg/client/clientset/versioned/typed/serving/v1/fake/fake_serving_client.go Add fake DomainMappings getter in fake ServingV1 client.
pkg/client/clientset/versioned/typed/serving/v1/fake/fake_domainmapping.go Add fake typed client implementation for v1 DomainMappings.
pkg/client/clientset/versioned/typed/serving/v1/domainmapping.go Add typed REST client for v1 DomainMappings.
pkg/apis/serving/v1beta1/domainmapping_conversion.go Add v1beta1↔v1 conversion methods for DomainMapping.
pkg/apis/serving/v1/zz_generated.deepcopy.go Add deepcopy support for v1 DomainMapping types.
pkg/apis/serving/v1/register.go Register v1 DomainMapping types in scheme.
pkg/apis/serving/v1/domainmapping_validation_test.go Add validation tests for v1 DomainMapping.
pkg/apis/serving/v1/domainmapping_validation.go Add v1 DomainMapping validation logic.
pkg/apis/serving/v1/domainmapping_types_test.go Add basic type behavior test (GetStatus) for v1 DomainMapping.
pkg/apis/serving/v1/domainmapping_types.go Add v1 DomainMapping API types/constants.
pkg/apis/serving/v1/domainmapping_lifecycle_test.go Add lifecycle/conditions tests for v1 DomainMapping.
pkg/apis/serving/v1/domainmapping_lifecycle.go Add lifecycle/conditions implementation for v1 DomainMapping.
pkg/apis/serving/v1/domainmapping_defaults_test.go Add defaulting tests for v1 DomainMapping.
pkg/apis/serving/v1/domainmapping_defaults.go Add defaulting implementation for v1 DomainMapping.
pkg/apis/serving/v1/domainmapping_conversion.go Add v1 conversion stubs consistent with other v1 hub types.
config/core/300-resources/domain-mapping.yaml Update CRD to serve v1 (storage) and keep v1beta1 served (non-storage) with v1 schema.
cmd/webhook/main.go Register v1 DomainMapping in webhook type map for defaulting/validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 31 to 34
"knative.dev/pkg/reconciler"
v1 "knative.dev/serving/pkg/apis/serving/v1"
"knative.dev/serving/pkg/apis/serving/v1beta1"
servingv1 "knative.dev/serving/pkg/apis/serving/v1"
"knative.dev/serving/test"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import block brings in the same package path twice (knative.dev/serving/pkg/apis/serving/v1) under two different aliases (v1 and servingv1). Go disallows duplicate imports of the same path, so this will not compile. Please use a single import alias and reference both Service and DomainMapping types through that alias (or split the usage so only one alias is needed).

Copilot uses AI. Check for mistakes.
Comment on lines +285 to +287
ctx = apis.WithinUpdate(ctx, test.prev)
if diff := cmp.Diff(test.want.Error(), test.this.Validate(ctx).Error()); diff != "" {
t.Error("Validate (-want, +got) =", diff)
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test.want is nil for the "update lastModifier annotation with spec changes" case, so calling test.want.Error() will panic. Please compare errors in a nil-safe way (e.g., compare *apis.FieldError directly, or convert both to strings with a helper that returns "" for nil).

Copilot uses AI. Check for mistakes.
Comment on lines 116 to 118
Verb: "delete",
Resource: v1beta1.SchemeGroupVersion.WithResource("clusterdomainclaims"),
Resource: servingv1.SchemeGroupVersion.WithResource("clusterdomainclaims"),
},
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This expected delete action is for NetworkingV1alpha1().ClusterDomainClaims().Delete(...), so the Resource GVR should use the networking API group/version (e.g. networking/v1alpha1), not serving.knative.dev/v1. As written, the test's WantDeletes resource won't match the action produced by the reconciler.

Copilot uses AI. Check for mistakes.
Comment thread test/clients.go
Comment on lines 49 to 52
// ServingBetaClients holds instances of interfaces for making requests to knative serving clients.
type ServingBetaClients struct {
DomainMappings servingv1beta1.DomainMappingInterface
DomainMappings servingv1.DomainMappingInterface
}
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServingBetaClients now exposes a serving/v1 DomainMappingInterface, so the type name and its doc comment are misleading (these are no longer v1beta1/beta clients for DomainMapping). Consider renaming this struct/field (or at least updating the comment) to reflect that DomainMappings are accessed via v1 even when using ServingBetaClient in tests.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 67.92453% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.21%. Comparing base (bbc132d) to head (e979283).

Files with missing lines Patch % Lines
...g/apis/serving/v1beta1/domainmapping_conversion.go 0.00% 32 Missing ⚠️
pkg/apis/serving/v1/domainmapping_lifecycle.go 81.25% 11 Missing and 1 partial ⚠️
pkg/apis/serving/v1/domainmapping_conversion.go 0.00% 4 Missing ⚠️
pkg/reconciler/testing/v1/listers.go 0.00% 2 Missing ⚠️
pkg/reconciler/domainmapping/controller.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16565      +/-   ##
==========================================
+ Coverage   80.16%   80.21%   +0.04%     
==========================================
  Files         217      223       +6     
  Lines       13542    17449    +3907     
==========================================
+ Hits        10856    13996    +3140     
- Misses       2320     3089     +769     
+ Partials      366      364       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move DomainMapping from Beta to GA

2 participants