Skip to content

[TSLA-11619] Make GetKeyCertPEM select key/cert pair deterministically#5008

Merged
Brian-McM merged 1 commit into
tigera:masterfrom
RoryDoherty:tigera-dex-cloud-fix
Jul 13, 2026
Merged

[TSLA-11619] Make GetKeyCertPEM select key/cert pair deterministically#5008
Brian-McM merged 1 commit into
tigera:masterfrom
RoryDoherty:tigera-dex-cloud-fix

Conversation

@RoryDoherty

@RoryDoherty RoryDoherty commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

What

GetKeyCertPEM ranged over a Go map of key/cert field-name pairs, so when a
secret held more than one recognized pair (e.g. standard tls.crt/tls.key
alongside a legacy cert/key kept during a cert-rotation overlap), the
returned cert was non-deterministic due to randomized map iteration.

Why

For the Voltron tunnel secret this flipped the KeyPair hash annotation between
reconciles, changing the tigera-manager pod template hash and triggering
spurious Voltron rolling restarts that dropped managed-cluster tunnels.

Fix

Select the key/cert pair in a fixed priority order (standard tls.crt/tls.key
first, then legacy names). Adds a regression test asserting deterministic
selection when both pairs are present.

Release Note

NONE

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@Brian-McM

Copy link
Copy Markdown
Contributor

/sem approve

@Brian-McM

Copy link
Copy Markdown
Contributor

/sem-approve

@RoryDoherty RoryDoherty force-pushed the tigera-dex-cloud-fix branch from 87ed060 to b28e353 Compare July 13, 2026 18:55
@Brian-McM

Copy link
Copy Markdown
Contributor

/sem-approve

@Brian-McM Brian-McM merged commit 20ccb70 into tigera:master Jul 13, 2026
6 checks passed
@RoryDoherty RoryDoherty deleted the tigera-dex-cloud-fix branch July 13, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants