kubernetes-sigs / gateway-api

Repository for the next iteration of composite service (e.g. Ingress) and load balancing APIs.
https://gateway-api.sigs.k8s.io
Apache License 2.0
1.77k stars 458 forks source link

Conformance tests for BackendTLSPolicy #3138

Open candita opened 3 months ago

candita commented 3 months ago

What would you like to be added: Conformance tests for BackendTLSPolicy. Comment below if you're interested in working on covering any of these areas.

Core Capabilities:

Why this is needed: This is needed in order for BackendTLSPolicy to graduate from v1alpha3 to v1.

candita commented 3 months ago

cc @whitneygriffith @mlavacca

whitneygriffith commented 2 months ago

1897

mlavacca commented 2 months ago

Invalid: both CACertificateRef and WellKnownCACertificates is specified

I think this test cannot be implemented, as this rule is directly enforced by CEL:

https://github.com/kubernetes-sigs/gateway-api/blob/d49ae960279b7022c8f7e041221df306ef64094d/apis/v1alpha3/backendtlspolicy_types.go#L81

mlavacca commented 2 months ago

Valid BackendTLSPolicy with 1 targetRef/service using WellKnownCACertificates and matching hostname

WellKnownCACertificates is an implementation-specific feature, therefore I think we should either:

If we go the second way, though, in my opinion, this is beyond the bare minimum set of conformance tests needed for graduation.

mlavacca commented 2 months ago

Invalid: targetRef in different namespace

The TargetRef is a LocalPolicyTargetReference, there is no namespace field in it. I think that a TargetRef in a different namespace is impossible, given the current API state.

https://github.com/kubernetes-sigs/gateway-api/blob/86c06a0b62587a627a9929d5943c5894a608ad62/apis/v1alpha2/policy_types.go#L39-L48

keithmattix commented 2 months ago

/assign @candita @whitneygriffith

whitneygriffith commented 1 month ago

Invalid: targetRef in different namespace The TargetRef is a LocalPolicyTargetReference, there is no namespace field in it. I think that a TargetRef in a different namespace is impossible, given the current API state.

I agree, we don't need a conformance test for this case. The same applies for Invalid: Namespace (of targetRef) not set.

whitneygriffith commented 1 month ago

Updated test cases:

Removed test cases: