mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
fix issue when end_user_license_agreeement is defined but value is nil or empty string (#30595)
relates to [#28691](https://github.com/fleetdm/fleet/issues/28691) This fixes an issue where `end_user_license_agreeement` is defined but is an empty string or nil. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved handling of the end user license agreement (EULA) field in app configuration to ensure it is always set correctly and removed from the configuration map after processing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
b2a1187808
commit
499e4e30e8
1 changed files with 10 additions and 6 deletions
|
|
@ -1797,13 +1797,17 @@ func (c *Client) DoGitOps(
|
||||||
WindowsEnabledAndConfigured: optjson.SetBool(windowsEnabledAndConfiguredAssumption),
|
WindowsEnabledAndConfigured: optjson.SetBool(windowsEnabledAndConfiguredAssumption),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check for the eula in the mdmAppConfig. If it exists we want to delete it
|
|
||||||
// from the app config so it will not be applied to the group/team though the
|
// check for the eula in the mdmAppConfig. If it exists we want to assign it
|
||||||
// ApplyGroup method. It will be applied separately.
|
// to eulaPath so that it will be applied later. We always delete it from
|
||||||
if endUserLicenseAgreement, ok := mdmAppConfig["end_user_license_agreement"].(string); ok && len(endUserLicenseAgreement) > 0 {
|
// mdmAppConfig so it will not be applied to the group/team though the
|
||||||
eulaPath = endUserLicenseAgreement
|
// ApplyGroup method.
|
||||||
delete(mdmAppConfig, "end_user_license_agreement")
|
if endUserLicenseAgreement, exists := mdmAppConfig["end_user_license_agreement"]; !exists || endUserLicenseAgreement == nil || (endUserLicenseAgreement == "") {
|
||||||
|
eulaPath = ""
|
||||||
|
} else if eulaStr, ok := endUserLicenseAgreement.(string); ok && len(eulaStr) > 0 {
|
||||||
|
eulaPath = eulaStr
|
||||||
}
|
}
|
||||||
|
delete(mdmAppConfig, "end_user_license_agreement")
|
||||||
|
|
||||||
group.AppConfig.(map[string]interface{})["scripts"] = scripts
|
group.AppConfig.(map[string]interface{})["scripts"] = scripts
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue