Skip to content

Back end - Add "Update new hosts" config #36188

@sgress454

Description

@sgress454

Related user story

#31293

Task

This task is to implement the back-end changes needed to set the new "update all hosts" setting on macos_updates, and to check for this setting when determining whether to update a device's OS during setup.

  • Create the new config in

    fleet/server/fleet/app.go

    Lines 322 to 328 in 25d9420

    type AppleOSUpdateSettings struct {
    // MinimumVersion is the required minimum operating system version.
    MinimumVersion optjson.String `json:"minimum_version"`
    // Deadline the required installation date for Nudge to enforce the required
    // operating system version.
    Deadline optjson.String `json:"deadline"`
    }
  • Add the new logic in needsOSUpdateForDEPEnrollment() to check the setting. If we only want to check this for macOS right now, be sure to add a platform check as well.
  • I think GitOps should pick this up automatically, since we just push up the whole JSON...
  • ...but we'll need to update generate-gitops (tests for sure, maybe logic too)

Condition of satisfaction

The new macos_updates.update_new_hosts setting should be...

  • settable via the PATCH /fleet/config endpoint (for no team)
  • returned from the GET /fleet/config endpoint (for no team)
  • settable via the PATCH /fleet/teams/:id endpoint (for a team)
  • returned from the GET /fleet/teams/:id endpoint (for no team)
  • settable via GitOps for "no team"
  • settable via GitOps for a team
  • output by fleetctl generate-gitops in default.yml
  • output by fleetctl generate-gitops in teams/<team-name>.yml

When update_new_hosts is changed for a team:

  • a new enabled_macos_update_new_hosts activity will be generated if the setting is true
  • a new disabled_macos_update_new_hosts activity will be generated if the setting is false

Metadata

Metadata

Assignees

Labels

#g-orchestrationOrchestration product group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.~sub-taskA technical sub-task that is part of a story. (Not QA'd. Not estimated.)

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions