Skip to content

Conversation

@sbueringer
Copy link
Member

@sbueringer sbueringer commented Oct 10, 2025

Signed-off-by: Stefan Büringer [email protected]

What this PR does / why we need it:
The client certificate doesn't really make sense in ClusterCache as it has nothing to do with what ClusterCache is otherwise doing. Accordingly this PR deprecates GetClientCertificatePrivateKey.

Additionally KCP is now caching the client cert in a local cache instead of using GetClientCertificatePrivateKey.

Going forward this will also make it easy to use the same EncryptionAlgorithm for the etcd client cert than what we use in other parts of KCP (for CAs, kubeconfig, ...)

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Also a pre-refactoring to simplify #10077

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 10, 2025
@k8s-ci-robot k8s-ci-robot added do-not-merge/needs-area PR is missing an area label size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 10, 2025
@sbueringer sbueringer added area/clustercache Issues or PRs related to the clustercachetracker area/provider/control-plane-kubeadm Issues or PRs related to KCP labels Oct 10, 2025
@k8s-ci-robot k8s-ci-robot removed do-not-merge/needs-area PR is missing an area label labels Oct 10, 2025
@sbueringer
Copy link
Member Author

/assign @fabriziopandini

/cc @Karthik-K-N (just fyi)

@stmcginnis
Copy link
Contributor

Makes sense. Looks like everything is covered as far as I can see.

Doesn't look like the golangci-lint failure is related to this change.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 2240c6c18f4147bc4e11a860ab475c680250fab4

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2025
@sbueringer
Copy link
Member Author

Sorry had to push a small fix. The cache variable was shadowed in the else branch (https://github.com/kubernetes-sigs/cluster-api/compare/007f4d7ca9a46ba34e55d081b143ba3c3d586240..b7bcb461aaa5e62ce25f4c2723ff38b61228a018)

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

if err != nil {
return nil, err
// Get client cert from cache if possible, otherwise generate it and add it to the cache.
// TODO: When we implement ClusterConfiguration.EncryptionAlgorithm we should add it to
Copy link
Member Author

Choose a reason for hiding this comment

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

Will be done as part of #10077 (comment)

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Might be we should add a note to the migration doc about the deprecated method, but no strong opinion (I do not expect someone using this, it is really KCP specific)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 13, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 20a7caa5ab7e6ddab3ac21629cc2deff8f267246

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 Oct 13, 2025
@k8s-ci-robot k8s-ci-robot merged commit 15a4355 into kubernetes-sigs:main Oct 13, 2025
24 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.12 milestone Oct 13, 2025
@sbueringer sbueringer deleted the pr-kcp-client-key branch October 13, 2025 09:55
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/clustercache Issues or PRs related to the clustercachetracker area/provider/control-plane-kubeadm Issues or PRs related to KCP cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants