Commit 1dedfdd
feat(anc): add check-hotfix subcommand to read hotfix pointer from LPS
Add a fail-open 'check-hotfix' CLI subcommand that reads the base->hotfix
pointer map from the live-patching-service (LPS) over the IMDS-attested SNI
path that is reachable pre-kubelet, and stages the resolved {hotfixes:{...}}
pointer to the path download-hotfix already reads. download-hotfix keeps its
unchanged patch-only, strictly-higher gating; check-hotfix only fetches and
writes the pointer.
- Raw net/http HTTPS GET (no client-go). TLS ServerName pinned to the LPS
SNI host while the TCP dial is forced to the apiserver FQDN (curl --resolve
trick); Authorization is the IMDS attested-data signature; the server cert
is verified against the cluster CA from the provision-config.
- FQDN + cluster CA come from the AKSNodeConfig ANC already parses (the only
credential source present pre-provisioning); caSource is logged.
- Shares the hotfixConfig parser/data contract with download-hotfix.
- Always exits 0; emits CheckHotfix telemetry (lpsRead, noHotfixForBase,
noHotfixAvailable, customDataFallback, failed).
- A reachable LPS with no hotfix published for this node (HTTP 401, 403, 404)
is a benign no-op (noHotfixAvailable): no overlay is staged and it is never
classified as a failure. Only transport/5xx failures fall back.
- PoC cold-start fallback reads a lenient top-level hotfixes object from the
node config when the LPS read fails (TODO: typed contract field).
- Injectable App fields (checkHotfixFetcher, fetchAttestedToken,
nodeConfigPath) for network-free unit tests.
- The LPS route + response schema are a planned-maintenance deliverable that
is not finalized; lpsHotfixPath is a clearly-marked placeholder with a TODO.
The IMDS/LPS client helpers mirror the connectivity prototype and should be
de-duplicated into a shared LPS client when that lands.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 5a1778c commit 1dedfdd
3 files changed
Lines changed: 1140 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
| |||
137 | 149 | | |
138 | 150 | | |
139 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
140 | 162 | | |
141 | 163 | | |
142 | 164 | | |
| |||
0 commit comments