mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-23 09:55:55 +00:00
detectFileUpgrades hard-coded the kind: lookup at apiVersion line+1, so manifests with any other field (metadata:, comments, annotations) or reversed field order silently returned "no migration needed" even when apiVersion was deprecated (#5839). Search within the current YAML document boundaries: scan backwards to the previous '---' separator or start-of-file, then forwards to the next '---' separator. First kind: line wins. The order is backwards-then-forwards so that for a conventional apiVersion/kind ordering we only scan the single line + the document boundary; the forward fallback covers the reversed-order case. Adds a regression fixture with three documents covering: - apiVersion first, kind after metadata: - kind first, apiVersion after metadata: - kind first, apiVersion last Fixes #5839 Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| flux | ||