Skip to content

Fix hash instability, file collision, and sort performance#1826

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:prep
Jun 10, 2026
Merged

Fix hash instability, file collision, and sort performance#1826
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:prep

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

Silent file loss when deploying from Flux sources with nested directories When reading files from a Flux source path, the code was keying each file by its bare filename rather than its path relative to the source root. If two files in different subdirectories shared the same name, the second one silently overwrote the first, causing part of the content to be dropped without any error. The fix uses the relative path as the key.

Non-deterministic hash for DriftExclusion ordering SortedDriftExclusions.Less() compared entries using only their Paths field. Two entries with identical paths but different Target fields compared as equal, so the sort was free to place them in any order. Because the sorted slice feeds directly into the spec hash used by ClusterPromotionReconciler, the hash could differ between runs for semantically identical specs, triggering spurious promotion re-evaluations. The sort now includes Target (Group, Version, Kind, Namespace, Name) as a stable tiebreaker.

Profile spec hash was non-deterministic for map fields and used a slow renderer

…ontroller

Silent file loss when deploying from Flux sources with nested directories
When reading files from a Flux source path, the code was keying each file by its
bare filename rather than its path relative to the source root. If two files in
different subdirectories shared the same name, the second one silently overwrote
the first, causing part of the content to be dropped without any error. The fix
uses the relative path as the key.

Non-deterministic hash for DriftExclusion ordering
SortedDriftExclusions.Less() compared entries using only their Paths field.
Two entries with identical paths but different Target fields compared as equal,
so the sort was free to place them in any order. Because the sorted slice feeds
directly into the spec hash used by ClusterPromotionReconciler, the hash could
differ between runs for semantically identical specs, triggering spurious promotion
re-evaluations. The sort now includes Target (Group, Version, Kind, Namespace, Name)
as a stable tiebreaker.

Profile spec hash was non-deterministic for map fields and used a slow renderer
@gianlucam76 gianlucam76 merged commit daf7b13 into projectsveltos:main Jun 10, 2026
9 checks passed
@gianlucam76 gianlucam76 deleted the prep branch June 10, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant