Show kickstart flag warning only when set (#13924)

The initial implementation of this warning in #12072 used the same `if
!c.Bool("disable-kickstart-softwareupdated")` check as the old code, but
the body of the `if` was the kickstart which was being skipped, now it
is the warning. So currently the warning is showing only when the flag
is *not* used.

I'm not building this software myself, just an end user who had a
version of this assigned to my machine. Since I noticed the warning in
logs and figured I'd submit a PR, please feel free to take it over to
finish the checklist.
This commit is contained in:
Adam Gashlin 2023-10-27 13:08:50 -07:00 committed by GitHub
parent f6db734e81
commit e349f6e205
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -347,7 +347,7 @@ func main() {
go osservice.SetupServiceManagement(constant.SystemServiceName, systemChecker.svcInterruptCh, appDoneCh)
// sofwareupdated is a macOS daemon that automatically updates Apple software.
if !c.Bool("disable-kickstart-softwareupdated") && runtime.GOOS == "darwin" {
if c.Bool("disable-kickstart-softwareupdated") && runtime.GOOS == "darwin" {
log.Warn().Msg("fleetd no longer automatically kickstarts softwareupdated. The --disable-kickstart-softwareupdated flag, which was previously used to disable this behavior, has been deprecated and will be removed in a future version")
}