Skip to content

Conversation

snorwin
Copy link
Member

@snorwin snorwin commented Aug 23, 2025

What type of PR is this?

/kind test
/area conformance-machinery

What this PR does / why we need it:
This PR simplifies the test infrastructure for BackendTLSPolicy by reusing the existing backend-tls Deployment instead of creating a separate backend. In addition, it fixes the CA certificate creation process as a CA certificates typically do not contain hostnames and following best practices, the CA certificate private key is now omitted from the ConfigMap.

The refactoring was validated by re-running the BackendTLSPolicy tests against Envoy Gateway and Airlock Microgateway, all of which passed successfully.

Which issue(s) this PR fixes:

Fixes #3934

Does this PR introduce a user-facing change?:

NONE

…code

Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/test area/conformance-machinery Issues or PRs related to the machinery and the suite used to run conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 23, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 23, 2025
@snorwin
Copy link
Member Author

snorwin commented Aug 23, 2025

/cc @candita @kl52752

@snorwin snorwin changed the title simplify BackendTLSPolicy test infrastructure and remove unnecessary … simplify BackendTLSPolicy test infrastructure and remove unnecessary code Aug 23, 2025
@snorwin
Copy link
Member Author

snorwin commented Aug 23, 2025

In case that #3983 is merged before this PR, the changes here will also need to be applied to the BackendTLSPolicySANValidation tests.

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 cleaning this up! One question impacting SAN tests that are in review

@snorwin snorwin requested a review from kl52752 August 25, 2025 17:33
@snorwin
Copy link
Member Author

snorwin commented Aug 25, 2025

@shaneutt, it would be great if we could get this merged before the code freeze.

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, looks good now :)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kl52752, snorwin
Once this PR has been reviewed and has the lgtm label, please assign kflynn for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@kl52752
Copy link
Contributor

kl52752 commented Aug 26, 2025

/lgtm

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

snorwin commented Aug 26, 2025

In the community meeting, we agreed to wait on merging this until #3983 is merged.
/hold
/cc @kl52752

@k8s-ci-robot k8s-ci-robot requested a review from kl52752 August 26, 2025 15:16
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 26, 2025
@shaneutt shaneutt moved this to Review in Release v1.4.0 Aug 26, 2025
@shaneutt shaneutt added this to the v1.4.0 milestone Aug 26, 2025
@shaneutt shaneutt self-assigned this Aug 26, 2025
"github.com/stretchr/testify/require"
)

func Test_generateCACert(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove the test? we still have the generateCACert helper function right? I mean, was this test failing or is this test not being useful?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was only for testing that the CA certificate contained the specified hostnames, which does not make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/conformance-machinery Issues or PRs related to the machinery and the suite used to run conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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
Status: Review
Development

Successfully merging this pull request may close these issues.

BackendTLSPolicy conformance test - re-use the tls-backend or deploy as infra
5 participants