Skip to content

Conversation

@snorwin
Copy link
Member

@snorwin snorwin commented Aug 15, 2025

What type of PR is this?

/kind test
/area conformance-test

What this PR does / why we need it:
Add a conformance test for BackendTLSPolicy to verify that the observedGeneration is correctly updated for all status conditions, similar to the GatewayClassObservedGenerationBump or HTTPRouteObservedGenerationBump test.

Which issue(s) this PR fixes:

N/A

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/test area/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 15, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 15, 2025
@snorwin
Copy link
Member Author

snorwin commented Aug 15, 2025

/cc @kl52752

@k8s-ci-robot
Copy link
Contributor

@snorwin: GitHub didn't allow me to request PR reviews from the following users: kl52752.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @kl52752

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-sigs/prow repository.


// BackendTLSPolicyMustHaveLatestConditions will fail the test if there are
// conditions that were not updated
func BackendTLSPolicyMustHaveLatestConditions(t *testing.T, r *v1alpha3.BackendTLSPolicy) {
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this a subset of BackendTLSPolicyMustHaveCondition?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not exactly, it doesn’t explicitly assert the observedGeneration bump, but I agree it’s implicitly covered in the BackendTLSPolicyMustHaveCondition since the results of ConditionsHaveLatestObservedGeneration is used as a retry condition.

Signed-off-by: Norwin Schnyder <[email protected]>
@rikatz
Copy link
Member

rikatz commented Aug 18, 2025

Thanks @snorwin I would do a quick run here but lgtm from my side.

I will wait @kl52752 to take a look as well

Copy link
Contributor

@kl52752 kl52752 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, LGTM :)

@rikatz
Copy link
Member

rikatz commented Aug 18, 2025

/lgtm
Thanks @snorwin, tested here against envoy-gateway, works fine. Checked the whole resource observedGeneration evolution vs the test, it reflects the expected

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 18, 2025
@snorwin
Copy link
Member Author

snorwin commented Aug 18, 2025

/assign @arkodg

@robscott
Copy link
Member

Thanks @snorwin!

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kl52752, rikatz, robscott, snorwin

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2025
@k8s-ci-robot k8s-ci-robot merged commit 804d644 into kubernetes-sigs:main Aug 18, 2025
19 checks passed
namespace: gateway-conformance-infra
spec:
selector:
app: observed-generation-bump-test
Copy link
Contributor

@zirain zirain Oct 21, 2025

Choose a reason for hiding this comment

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

Any reason we use a service without endpoints here?
Why not use tls-backned directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea was simply to use a dummy Service to link the BackendTLSPolicy to an HTTPRoute. Does this cause any issues in your testing infrastructure?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, EG return 503 directly, which means the process of BackendTLSPolicy is skipped.
is it better to use a valid servcie here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This test only verifies how the status is updated, i.e., that the observed generation is set and updated.
How does a direct 503 response from the data plane influence this test? Sorry for asking again, but I’m trying to understand whether this is truly an issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

EG skips to process TLSPolicy for a servcie when there's no valid endpoint behide it.

We can move the process before the endpoint checking, just want to understand better why not using a valid service?

Copy link
Member Author

Choose a reason for hiding this comment

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

Understood. Could you please open a PR for it? However, I don’t expect it will be backported and released before v1.5.

tylerauerbeck pushed a commit to tylerauerbeck/gateway-api that referenced this pull request Nov 27, 2025
…netes-sigs#3997)

* BackendTLSPolicy conformance tests for observedGeneration bump

Signed-off-by: Norwin Schnyder <[email protected]>

* Apply PR feedback

Signed-off-by: Norwin Schnyder <[email protected]>

---------

Signed-off-by: Norwin Schnyder <[email protected]>
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/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/test lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. 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.

7 participants