Skip to content

Log when managed OS upgrades are enabled - #276

Merged
Cheuk (cheukt) merged 1 commit into
viamrobotics:mainfrom
cheukt:log-managed-upgrade-status
Jul 28, 2026
Merged

Log when managed OS upgrades are enabled#276
Cheuk (cheukt) merged 1 commit into
viamrobotics:mainfrom
cheukt:log-managed-upgrade-status

Conversation

@cheukt

@cheukt Cheuk (cheukt) commented Jul 28, 2026

Copy link
Copy Markdown
Member

Problem

There is no positive log signal that managed OS upgrade mode is active.

The other nearby signal, Disabled OS auto-upgrades., made this worse: that branch in EnforceUpgrades is shared by disable and the two managed modes, so the message read as "upgrades are off" in exactly the case where the agent had taken over installing them.

Changes

  • New logManagedUpgradesStarted helper in managed_upgrades_common.go, called from startManagedUpgrades on both Linux and Windows once the interval is clamped:

    Managed OS upgrades enabled, viam-agent will install updates directly
        os_auto_upgrade_type=managed-security  check_interval=24h0m0s
    

    It lives in the common file so the two platforms can't drift, and logs the clamped interval rather than the raw config value.

Testing

go build / go vet clean for linux, windows, and darwin; go test ./utils/ passes. No behavior change beyond logging.

🤖 Generated with Claude Code

There was no positive log signal that managed upgrade mode was active. The
only evidence was an upgrade actually running, which never happens on a
device whose maintenance window has been closed since boot, so those devices
looked identical to ones with upgrades turned off.

Log the mode and check interval once when the background upgrade loop starts,
on both Linux and Windows.

Also split the message logged when apt unattended-upgrades is disabled. That
branch is shared by the "disable" and managed modes, so the old text was
ambiguous about whether anything would still install updates.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cheukt
Cheuk (cheukt) merged commit 4d65da1 into viamrobotics:main Jul 28, 2026
6 checks passed
@cheukt
Cheuk (cheukt) deleted the log-managed-upgrade-status branch July 28, 2026 21:11
Evan Dorsky (EvanDorsky) pushed a commit to EvanDorsky/viam-agent that referenced this pull request Aug 3, 2026
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants