Skip to content

PodCertificateRequest v1 support - #1829

Merged
Eitan Yarmush (EItanya) merged 1 commit into
agent-substrate:mainfrom
howardjohn:pcr/v1
Sep 25, 2026
Merged

Eitan Yarmush (EItanya) merged 1 commit into
agent-substrate:mainfrom
howardjohn:pcr/v1

Conversation

@howardjohn

Copy link
Copy Markdown
Collaborator

This adds dual v1beta1 and v1 PCR support, favoring v1. We have seen users on v1.37 without v1beta1 but with v1 seeing incomaptibility.

Given our usage of PCR is pretty scoped its not too bad to have the dual version support.

Fixes #<issue_number_goes_here>

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

This adds dual v1beta1 and v1 PCR support, favoring v1. We have seen
users on v1.37 without v1beta1 but with v1 seeing incomaptibility.

Given our usage of PCR is pretty scoped its not too bad to have the dual
version support.

@EItanya Eitan Yarmush (EItanya) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 AI-generated review.

Non-blocking compatibility note: with a 1.37 control plane and 1.35 kubelets, legacy PCRs contain PKIXPublicKey, which Kubernetes omits when serving them through v1. Preferring v1 therefore prevents these requests from being signed, even when v1beta1 remains available. This combination is allowed by Kubernetes' version-skew policy.

Documenting that nodes using these certificates must run kubelet 1.36+ before upgrading the control plane to 1.37 would be a reasonable resolution; this doesn't need to block the PR on adding fallback code.


// GetCached reads from the owned informer cache and returns the signers' beta representation.
// Callers must treat the result as read-only, as with a standard lister.
func (c *Client) GetCached(namespace, name string) (*certsv1beta1.PodCertificateRequest, error) {

@EItanya Eitan Yarmush (EItanya) Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Can we just say Get? GetCached seems to just leak the detail

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The distinction is pretty important when dealing with informers

@EItanya

Copy link
Copy Markdown
Collaborator

This solution makes sense to me, I think Taahir Ahmed (@ahmedtd) should also take a look

@atroisi93

Copy link
Copy Markdown

Hi, I noticed that ClusterTrustBundle operations still use v1beta1, although the API is stable in Kubernetes 1.37. Would adding v1 support for those operations fit within this PR?

@howardjohn

Copy link
Copy Markdown
Collaborator Author

Hi, I noticed that ClusterTrustBundle operations still use v1beta1, although the API is stable in Kubernetes 1.37. Would adding v1 support for those operations fit within this PR?

I think it fits but I didn't want to bloat up this PR


// GetCached reads from the owned informer cache and returns the signers' beta representation.
// Callers must treat the result as read-only, as with a standard lister.
func (c *Client) GetCached(namespace, name string) (*certsv1beta1.PodCertificateRequest, error) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The distinction is pretty important when dealing with informers


// toBeta copies the fields shared by the stable and beta APIs.
func toBeta(pcr *certsv1.PodCertificateRequest) *certsv1beta1.PodCertificateRequest {
pcr = pcr.DeepCopy()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure if the clone is needed, assuming the caller continues to treat the result as read-only. But I don't mind much either way.

@EItanya
Eitan Yarmush (EItanya) added this pull request to the merge queue Sep 25, 2026
Merged via the queue into agent-substrate:main with commit 10a1bfb Sep 25, 2026
11 checks passed
@bowei Bowei Du (bowei) added area/security Security related issue/pr kind/feature An enhancement / feature request or implementation labels Sep 29, 2026
Julian Gutierrez Oschmann (juli4n) pushed a commit to juli4n/substrate that referenced this pull request Oct 1, 2026
Relates to agent-substrate#1819

This is the followup to agent-substrate#1829 which did PCR.

> It's a good idea to open an issue first for discussion.

- [x] Tests pass
- [x] Appropriate changes to documentation are included in the PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/security Security related issue/pr kind/feature An enhancement / feature request or implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants