Skip to main content

Module upgrade

Module upgrade 

Source
Expand description

Upgrade command implementation — download, verify, swap, and rollback.

This module implements the rusty upgrade flow:

  1. Check manifest version compatibility (runtime vs. manifest min_runtime_version)
  2. Download new binary from release URL
  3. Verify binary integrity (SHA-256 checksum against published value)
  4. Swap binary with backup of previous version
  5. Run smoke test to verify the new binary works
  6. Rollback on smoke test failure

Supports interactive confirmation and non-interactive --yes mode. Preserves cached remote manifest across upgrades. Operationally separate from rusty update.

Structs§

DownloadResult
Download result for an upgrade artifact.
ReleaseInfo
Metadata about an available upgrade target.
UpgradeOptions
Options controlling upgrade behavior.
UpgradeResult
Result of a successful upgrade operation.
VersionInfo
Version information for the current binary.

Enums§

UpgradeError
Errors that can occur during the upgrade process.
UpgradeStatus
Status of an upgrade attempt.

Traits§

BinaryDownloader
Trait for binary download. Implementations provide the actual download or test fixture data.
ReleaseProvider
Trait for release discovery. Implementations provide release info from a remote source or test fixture.
SmokeTester
Trait for smoke-testing a binary. Implementations run the new binary and check that it starts correctly.
UserInteractor
Trait for user interaction. Implementations provide interactive confirmation or auto-accept in non-interactive mode.

Functions§

check_schema_compatibility
Check if the current runtime’s schema version can handle a manifest with the given schema version.
check_version_compatibility
Check if current version satisfies the required minimum version. Returns Ok(()) if compatible, Err(UpgradeError) if not.
compute_checksum
Compute the SHA-256 checksum of a byte slice.
create_backup
Create a backup of the current binary.
current_binary_path
Get the current binary path.
default_backup_dir
Get the default backup directory path.
default_cached_manifest_path
Get the default cached manifest path.
read_cached_manifest
Read the cached remote manifest bytes if present.
rollback
Rollback to a previous binary version.
run_upgrade
Run the full upgrade flow.
swap_binary
Swap the old binary with the new one.
verify_integrity
Verify that data matches the expected SHA-256 checksum.
write_cached_manifest
Write the cached remote manifest bytes back (preservation after upgrade).