Problem
When a profile XML file is modified (not added or deleted), fleet-plan's --git mode does not report the change. Only new profiles and deleted profiles are shown.
Root Cause
Two issues in internal/diff/differ.go:
-
buildSourceMap() does not include p.Path (the profile XML file path) in the source-to-name mapping. When git reports a changed XML file, filterResourceDiff cannot match it to any profile name, so the change is silently filtered out.
-
diffProfiles() only detects added and deleted profiles. Since the Fleet API does not return profile content, there is no content comparison, so modifications to existing profiles are never detected.
Fix
- Add
p.Path to buildSourceMap() for profiles, matching the pattern used for software packages and fleet-maintained apps.
- Pass
changedFiles into diffProfiles() so that when a profile exists in both current and proposed state, but its XML path appears in the git changed-files list, it is reported as modified.
Problem
When a profile XML file is modified (not added or deleted), fleet-plan's
--gitmode does not report the change. Only new profiles and deleted profiles are shown.Root Cause
Two issues in
internal/diff/differ.go:buildSourceMap()does not includep.Path(the profile XML file path) in the source-to-name mapping. When git reports a changed XML file,filterResourceDiffcannot match it to any profile name, so the change is silently filtered out.diffProfiles()only detects added and deleted profiles. Since the Fleet API does not return profile content, there is no content comparison, so modifications to existing profiles are never detected.Fix
p.PathtobuildSourceMap()for profiles, matching the pattern used for software packages and fleet-maintained apps.changedFilesintodiffProfiles()so that when a profile exists in both current and proposed state, but its XML path appears in the git changed-files list, it is reported as modified.