Skip to content

stop using selfsigned certificate on tlsroute tests#4918

Open
rikatz wants to merge 1 commit into
kubernetes-sigs:mainfrom
rikatz:tlsroute-stop-using-selfsigned
Open

stop using selfsigned certificate on tlsroute tests#4918
rikatz wants to merge 1 commit into
kubernetes-sigs:mainfrom
rikatz:tlsroute-stop-using-selfsigned

Conversation

@rikatz
Copy link
Copy Markdown
Member

@rikatz rikatz commented May 28, 2026

What type of PR is this?
/kind bug
/kind cleanup
/area conformance-test

What this PR does / why we need it:

TLSRoute tests were using selfsigned certificate on the TCP backend, which makes other kinds of testing (like TCPRoute and TLSRoute with BackendTLSPolicy) need to import the secret from the backend instead of the CA that signed it.

This PR fixes it and the tests that were once relying on the secret

Which issue(s) this PR fixes:

Does this PR introduce a user-facing change?:

Fix TLSRoute conformance test to stop relying on self-signed certificates

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. area/conformance-test Issues or PRs related to Conformance tests. labels May 28, 2026
@k8s-ci-robot k8s-ci-robot requested review from candita and kl52752 May 28, 2026 18:49
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 28, 2026
@rikatz rikatz force-pushed the tlsroute-stop-using-selfsigned branch from c52b0a7 to 1fc4ab0 Compare May 28, 2026 19:51
Comment thread conformance/utils/tls/tls.go Outdated
}

// GetTLSSecret fetches the named Secret and converts both cert and key to []byte
func GetTLSSecret(client client.Client, secretName types.NamespacedName) ([]byte, []byte, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

now when it is in tls package TLS in name is redundant

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe it would fit better anyway into utils/kubernetes/certificate.go as the tls package is mainly used for creating and asserting TLS connections

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hum, moved to certificate.go, keeping the same function name for now

Comment thread conformance/utils/tls/tls.go Outdated
if err != nil {
return cert, key, fmt.Errorf("error fetching TLS Secret: %w", err)
}
cert = secret.Data["tls.crt"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it will be safer to check if those keys exists in test cases we are checking error but not if cert is not empty

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe too early for me, I don't follow this comment. Do you want me to add a check for the cert not being empty on each test?

Copy link
Copy Markdown
Member

@snorwin snorwin left a comment

Choose a reason for hiding this comment

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

@rikatz thanks, the fix looks good to me.

However, looking at this more broadly, I see quite a bit of potential to simplify and clean up the conformance suite .

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 29, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@snorwin
Copy link
Copy Markdown
Member

snorwin commented May 29, 2026

/hold (sorry @kl52752 I missed your comments)

@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 May 29, 2026
@rikatz
Copy link
Copy Markdown
Member Author

rikatz commented May 29, 2026

@snorwin like, this is our plan for 1.7 right? You and me will clean up this whole conformance test :P

@rikatz rikatz force-pushed the tlsroute-stop-using-selfsigned branch from 1fc4ab0 to c33db62 Compare May 29, 2026 18:50
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 29, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@rikatz: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-gateway-api-verify c33db62 link true /test pull-gateway-api-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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. I understand the commands that are listed here.

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

4 participants