Fixed parsing of relative paths for MDM profiles in gitops no-team.yml (#26046)
For #25770 We already unmarshal macOS/Windows settings (added by Martin), so we replace the path with an absolute file path and keep them unmarshalled so they don't have to be re-unmarshalled later. Note: the custom UnmarshalJSON method on these structs checks for (and handles) legacy format (before labels were added). Also some refactorings: - extracted `extractControlsForNoTeam` - reorganized `TestGitOpsBasicGlobalAndNoTeam` with subtests -- I did not actually change functionality of this test # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Added/updated automated tests - [x] A detailed QA plan exists on the associated ticket (if it isn't there, work with the product group's QA engineer to add it) - [x] Manual QA for all new/changed functionality
This commit is contained in:
@@ -218,9 +218,9 @@ func TestValidGitOpsYaml(t *testing.T) {
|
||||
}
|
||||
|
||||
// Check controls
|
||||
_, ok := gitops.Controls.MacOSSettings.(map[string]interface{})
|
||||
_, ok := gitops.Controls.MacOSSettings.(fleet.MacOSSettings)
|
||||
assert.True(t, ok, "macos_settings not found")
|
||||
_, ok = gitops.Controls.WindowsSettings.(map[string]interface{})
|
||||
_, ok = gitops.Controls.WindowsSettings.(fleet.WindowsSettings)
|
||||
assert.True(t, ok, "windows_settings not found")
|
||||
_, ok = gitops.Controls.EnableDiskEncryption.(bool)
|
||||
assert.True(t, ok, "enable_disk_encryption not found")
|
||||
|
||||
Reference in New Issue
Block a user