-
Notifications
You must be signed in to change notification settings - Fork 89
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
Support Gateway Selection using Ingress Labels #1250
Support Gateway Selection using Ingress Labels #1250
Conversation
@pastequo: The label(s) In response to this:
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/test-infra repository. |
Hi @pastequo. Thanks for your PR. I'm waiting for a knative-extensions member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1250 +/- ##
==========================================
- Coverage 80.51% 80.28% -0.24%
==========================================
Files 26 26
Lines 2022 2115 +93
==========================================
+ Hits 1628 1698 +70
- Misses 301 316 +15
- Partials 93 101 +8 ☔ View full report in Codecov by Sentry. |
139dd4f
to
1363f09
Compare
1363f09
to
23a0d7e
Compare
23a0d7e
to
1682c45
Compare
8548431
to
060b8f9
Compare
Contrary to what was documented, I felt like it was wrong to implement here the check about the number of gateway (for example a maximum of one external gateway should be selected thru labels) Even if it's not officially supported, a great part of the code acts as multiple gateway is possible. In particular, a lot of tests are using a configuration with multiple gateways. If the change is confirmed, I think it should be done on a separated PR |
You'll need to rebase since the prior PR merged.
I'll bring it up at the WG group meeting tomorrow to see what others think. My thoughts are given that we don't probe all gateways you could say allowing that behaviour is broken. If we have a plan to address the broken behaviour then we can drop the check. |
/ok-to-test |
Following up from the WG discussion - we'll want to add a check to ensure only a single gateway is selected (cause that's all we support). It's fine that this is done after this PR lands in a follow up change |
0682f4b
to
4985d97
Compare
c237ceb
to
af986a0
Compare
/retest |
af986a0
to
27c845a
Compare
Name: parts[0], | ||
Namespace: parts[1], | ||
// GetIngressGatewaySvcNameNamespaces gets the Istio ingress namespaces from ConfigMap for gateways that should expose the service. | ||
func GetIngressGatewaySvcNameNamespaces(ctx context.Context, obj kmeta.Accessor) ([]metav1.ObjectMeta, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that wherever we have a kmeta.Accessor we could replace it with ing *v1alpha1.Ingress
, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I used to have ing *v1alpha1.Ingress
& @dprotaso made me change for this. Which is imho better to depends on a small interface rather than an implementation
See #1250 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends generalizing for one case it is still weird but maybe a good fir for the GetLabels method.
} | ||
} | ||
|
||
func replaceTabs(s string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could have as an alternative, something like:
func toYamlNewFormatGateways(data []Gateway) string {
bytes, _ := yaml.Marshal(data)
return string(bytes)
}
"external-gateways": toYamlNewFormatGateways([]Gateway{
{
Namespace: "unused",
Name: "unused",
ServiceURL: "default.default.svc.cluster.local",
},
{
Namespace: "namespace",
Name: "gateway",
ServiceURL: "istio-gateway.istio-system.svc.cluster.local",
LabelSelector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{
Key: "key",
Operator: metav1.LabelSelectorOpIn,
Values: []string{"value"},
},
},
},
}},
),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I rather have a string that reflects exactly what a user would have written, rather than generate it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the scenarios you want to check just the user syntax yes, for the rest where you want to run test cases based on valid content it is safer. Anyway no strong preference.
f06b35a
to
72c817c
Compare
Do you mean aside from the google doc ? https://docs.google.com/document/d/12X1-9nhjAhpf-Wlt3RbdoMbvx31zFBva/edit#heading=h.gjdgxs Something here https://github.com/knative/docs ? Or somewhere else ? |
yes |
Issue created: knative/docs#5905 |
/approve Leaving lgtm for stavros |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, pastequo 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 |
@pastequo could you rebase pls so we can stamp it? |
0d92608
to
1f02be8
Compare
/lgtm |
/unhold |
🎉 thanks @pastequo for your help on landing this |
Changes
This PR was built on top of #1249
This is why there are a lot of changes (it includes 2 PRs in one)
/kind enhancement
Fixes #1248
Release Note
Docs