Repository navigation
Reconcile DomainMappings to Ingress - #9735
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9735 +/- ##
==========================================
- Coverage 87.98% 87.74% -0.25%
==========================================
Files 179 180 +1
Lines 8457 8492 +35
==========================================
+ Hits 7441 7451 +10
- Misses 772 792 +20
- Partials 244 249 +5
Continue to review full report at Codecov.
|
|
The following jobs failed:
Failed non-flaky tests preventing automatic retry of pull-knative-serving-istio-stable-no-mesh-tls: |
|
/retest |
| // DomainMappingSpec describes the DomainMapping the user wishes to exist. | ||
| type DomainMappingSpec struct { | ||
| // Ref points to an Addressable. | ||
| // Currently, Ref must be a KSvc. |
There was a problem hiding this comment.
I see the other comment, in practice I think it works with more than that, but this should be pretty easy to resolve more broadly (assuming the addressable doesn't use the path part, and implements our dataplane contract).
Comment seems fine for now, we should just be sure we clean it up 😅
There was a problem hiding this comment.
Yeah, I guess I'm a little conservative with the comment here - undercommit and overdeliver etc ;) Supporting arbitrary addressables is in the todo list in the tracking issue.
| // This assumes the target is a KSvc. To support arbitrary addressables | ||
| // we will need to resolve the reference to a URL in the same way that | ||
| // eventing does. | ||
| targetHostName := targetServiceName + "." + targetServiceNamespace + ".svc.cluster.local" |
There was a problem hiding this comment.
This would work with any service that implements our dataplane probe, it just makes an assumption about how URIs are resolved. I assume you know about the URI resolved in knative.dev/pkg?
There was a problem hiding this comment.
Wasn't suggesting for this PR btw, just hoping to save you time if you didn't.
There was a problem hiding this comment.
I didn't but I assumed I'd find something along those lines when the time came :D
There was a problem hiding this comment.
There was a problem hiding this comment.
Actually that's a good point, this should use that.
I'm talking about this: https://github.com/knative/pkg/blob/c0496d5e1b2bed5a988c80451061ed5b116057f8/resolver/addressable_resolver.go#L41
There was a problem hiding this comment.
Yah, TIL you can change cluster.local - cool! Will fix that tmr
There was a problem hiding this comment.
🤔 if we can do this with KinD, then we probably should try varying that across our KinD matrix 🤩
| Visibility: netv1alpha1.IngressVisibilityExternalIP, | ||
| HTTP: &netv1alpha1.HTTPIngressRuleValue{ | ||
| Paths: []netv1alpha1.HTTPIngressPath{{ | ||
| RewriteHost: targetHostName, |
There was a problem hiding this comment.
We should also set the vanity domain in this header:
There was a problem hiding this comment.
d'oh, yeah, good point, forgot that, one sec
| } | ||
|
|
||
| type DomainMappingOption func(dm *v1alpha1.DomainMapping) | ||
| type domainMappingOption func(dm *v1alpha1.DomainMapping) |
There was a problem hiding this comment.
The linter is unhappy with this change :(
There was a problem hiding this comment.
sigh. Guess I should lowercase the other functions to match
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Second part of #9713.
Reconciles DomainMappings to Ingresses. In the interests of keeping this PR small(-ish 😅) this only handles reconciling downwards, next PR will propagate the ingress status back up to the DomainMapping.
Also for now this assumes the target
refis a KSvc such that we can get the URL via{ref.name}.{ref.namespace}.svc.cluster.local(we also need that to be sure there's a k8s service for the target anyway). See #9713 for other todos./assign @mattmoor @dprotaso