system

package
v0.0.0-...-3bfe646 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Logger specifies the logger
	log.Logger
	// PackageUpdates describes the packages to update
	PackageUpdates
	// ChangesetID specifies the unique ID of this update operation
	ChangesetID string
	// Backend specifies the local host backend
	Backend storage.Backend
	// Packages specifies the local host package service
	Packages update.LocalPackageService
	// ClusterRole specifies cluster role of the node this system updater runs on
	ClusterRole string
	// SELinux controls SELinux support
	SELinux bool
}

Config defines the configuration of the system updater

type PackageUpdater

type PackageUpdater struct {
	// Logger specifies the logger
	log.Logger
	// Packages specifies the package service to use
	Packages update.LocalPackageService
	// ClusterRole specifies cluster role of the node this system updater runs on
	ClusterRole string
	// ServiceUser specifies the container service user
	ServiceUser systeminfo.User
	// SELinux specifies whether SELinux support is on
	SELinux bool
}

PackageUpdater manages the updates to a known subset of packages

func (*PackageUpdater) Reinstall

func (r *PackageUpdater) Reinstall(ctx context.Context, update storage.PackageUpdate) error

Reinstall reinstalls the package specified by update

type PackageUpdaterOption

type PackageUpdaterOption func(*PackageUpdater)

PackageUpdaterOption is a functional configuration option for PackageUpdater

func WithSELinux

func WithSELinux(on bool) PackageUpdaterOption

WithSELinux sets SELinux support

type PackageUpdates

type PackageUpdates struct {
	// Gravity specifies the gravity package update
	Gravity *storage.PackageUpdate
	// Runtime specifies the runtime package update
	Runtime storage.PackageUpdate
	// RuntimeSecrets specifies the update for the runtime secrets package
	RuntimeSecrets *storage.PackageUpdate
	// Teleport specifies the teleport package update
	Teleport *storage.PackageUpdate
}

PackageUpdates describes the packages to update

type System

type System struct {
	// Config specifies service configuration
	Config
}

System is a service to update system package on a node

func New

func New(config Config) (*System, error)

New returns a new system updater

func (*System) Rollback

func (r *System) Rollback(ctx context.Context, withStatus bool) (err error)

Rollback rolls back system to the specified changesetID or the last update if changesetID is not specified

func (*System) Update

func (r *System) Update(ctx context.Context, withStatus bool) error

Update applies updates to the system packages specified with config

func (*System) UpdateTctlScript

func (r *System) UpdateTctlScript(newPackage loc.Locator) error

UpdateTctlScript writes tctl script that invokes tctl binary from the specified package with appropriate configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL