这是indexloc提供的服务,不要输入任何密码
Skip to content

Prevent DomainMapping collisions using ClusterDomainClaim #10044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 5, 2020

Conversation

julz
Copy link
Member

@julz julz commented Nov 5, 2020

Part of #9713.

Use the new ClusterDomainClaim CRD to prevent domain name collisions. At this point, we auto-create the CDC as part of reconciling the DM.

/assign @mattmoor @vagababov

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 5, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 5, 2020
@knative-prow-robot knative-prow-robot added the area/API API objects and controllers label Nov 5, 2020
@codecov
Copy link

codecov bot commented Nov 5, 2020

Codecov Report

Merging #10044 into master will increase coverage by 0.02%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10044      +/-   ##
==========================================
+ Coverage   87.94%   87.96%   +0.02%     
==========================================
  Files         184      185       +1     
  Lines        8666     8683      +17     
==========================================
+ Hits         7621     7638      +17     
+ Misses        797      796       -1     
- Partials      248      249       +1     
Impacted Files Coverage Δ
pkg/reconciler/domainmapping/reconciler.go 85.18% <84.61%> (-0.53%) ⬇️
.../reconciler/domainmapping/resources/domainclaim.go 100.00% <100.00%> (ø)
pkg/autoscaler/scaling/multiscaler.go 89.74% <0.00%> (+1.70%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe18623...f43781d. Read the comment docs.

Comment on lines 135 to 140
if dc, err = r.netclient.NetworkingV1alpha1().ClusterDomainClaims().Create(ctx, &netv1alpha1.ClusterDomainClaim{
ObjectMeta: metav1.ObjectMeta{
Name: dm.Name,
OwnerReferences: []metav1.OwnerReference{*kmeta.NewControllerRef(dm)},
},
}, metav1.CreateOptions{}); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I'd move to resources/ and use that in the table test, it should cut down on boilerplate.

Copy link
Member Author

Choose a reason for hiding this comment

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

cool, good idea, willdo

Copy link
Member Author

Choose a reason for hiding this comment

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

(done)

@mattmoor
Copy link
Member

mattmoor commented Nov 5, 2020

Just a nit

@mattmoor
Copy link
Member

mattmoor commented Nov 5, 2020

Consider an e2e test to confirm that two DomainMappings created in separate serving namespaces work. We have serving-tests and serving-tests-alt for stuff like this.

What's in my head:

  1. Create one (works)
  2. Create other (fails to Ready)
  3. First one still works

@julz
Copy link
Member Author

julz commented Nov 5, 2020

e2e test sounds legit (I did test manually :)), I'll do that in a follow-on, if that's ok

@mattmoor
Copy link
Member

mattmoor commented Nov 5, 2020

Yeah, that's fine, just wanted to put it on your list 😉

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: julz, mattmoor

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

The pull request process is described here

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-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 5, 2020
@knative-prow-robot knative-prow-robot merged commit bd9da54 into knative:master Nov 5, 2020
@julz julz mentioned this pull request Nov 9, 2020
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants