Make sure the ingress namespace is same with service#6873
Make sure the ingress namespace is same with service#6873knative-prow-robot merged 1 commit intoknative:masterfrom
Conversation
|
Hi @MIBc. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
| all = all.Also(apis.ErrMissingField("serviceNamespace")) | ||
| } | ||
| // Service namespace should be same with ingress. | ||
| if b.ServiceNamespace != "" && b.ServiceNamespace != ctx.Value("ingressNamespace") { |
There was a problem hiding this comment.
else if to the above condition?
| // Validate inspects and validates Ingress object. | ||
| func (i *Ingress) Validate(ctx context.Context) *apis.FieldError { | ||
| return i.Spec.Validate(apis.WithinSpec(ctx)).ViaField("spec") | ||
| newContext := context.WithValue(ctx, "ingressNamespace", i.Namespace) |
There was a problem hiding this comment.
Should we use apis.WithinParent(apis.WithinSpec(ctx)) instead and fetch the meta below via ParentMeta?
| all = all.Also(apis.ErrMissingField("serviceNamespace")) | ||
| } else if b.ServiceNamespace != apis.ParentMeta(ctx).Namespace { | ||
| all = all.Also(&apis.FieldError{ | ||
| Message: "Ingress namespace is different with service", |
There was a problem hiding this comment.
| Message: "Ingress namespace is different with service", | |
| Message: "service namespace must match ingress namespace", |
(lowercase seems to be usual for these messages)
|
LGTM after @markusthoemmes comment |
* Validate whether the ingress namespace is same with service.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: markusthoemmes, mattmoor, MIBc 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 |
Fixes #6868
Proposed Changes