update

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: BSD-3-Clause-Clear Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelPendingUpdate

func CancelPendingUpdate(ctx context.Context, cfg *config.Config, opts *UpdateOptions) error

func Daemon

func Daemon(ctx context.Context, cfg *config.Config, opts *UpdateOptions)

func FillAndCheckAppsList

func FillAndCheckAppsList(updateContext *UpdateContext) error

func FillAppsList

func FillAppsList(updateContext *UpdateContext) error

func GenAndSaveEvent

func GenAndSaveEvent(updateContext *UpdateContext, eventType events.EventTypeValue, details string, success *bool) error

func GetAppsUris

func GetAppsUris(target *metadata.TargetFiles) ([]string, error)

func GetPendingUpdate

func GetPendingUpdate(updateContext *UpdateContext) error

func GetTargetToInstall

func GetTargetToInstall(updateContext *UpdateContext, cfg *config.Config, targetList target.Targets, targetId string) error

Returns information about the apps to install and to remove, as long as the corresponding target No update operation is performed at this point. Not even apps stopping

func GetVersion

func GetVersion(target *metadata.TargetFiles) (int, error)

func InitUpdate

func InitUpdate(updateContext *UpdateContext) error

func InitializeDatabase

func InitializeDatabase(dbFilePath string) error

func InstallTarget

func InstallTarget(updateContext *UpdateContext) error

func IsTargetRunning

func IsTargetRunning(updateContext *UpdateContext) (bool, error)

func PerformUpdate

func PerformUpdate(updateContext *UpdateContext) (bool, error)

func PullTarget

func PullTarget(updateContext *UpdateContext) error

func ReportAppsStates

func ReportAppsStates(config *sotatoml.AppConfig, client *client.GatewayClient, updateContext *UpdateContext) error

func StartTarget

func StartTarget(updateContext *UpdateContext) (bool, error)

func Update

func Update(ctx context.Context, cfg *config.Config, opts *UpdateOptions) error

Types

type AppServiceState

type AppServiceState struct {
	Name     string `json:"name"`
	Hash     string `json:"hash"`
	State    string `json:"state"`
	Status   string `json:"status"`
	Health   string `json:"health,omitempty"`
	ImageUri string `json:"image"`
	Logs     string `json:"logs,omitempty"`
}

type AppState

type AppState struct {
	Services []AppServiceState `json:"services"`
	State    string            `json:"state"`
	Uri      string            `json:"uri"`
}

type AppsState

type AppsState struct {
	Ostree     string              `json:"ostree"`
	DeviceTime string              `json:"deviceTime"`
	Apps       map[string]AppState `json:"apps"`
}

type UpdateContext

type UpdateContext struct {
	DbFilePath string

	Target             target.Target
	CurrentTarget      target.Target
	Reason             string
	RequiredApps       []string
	AppsToUninstall    []string
	InstalledApps      []string
	InstalledAppsNames []string
	ConfiguredAppNames []string
	TargetIsRunning    bool

	Context       context.Context
	ComposeConfig *compose.Config
	Runner        update.Runner

	PendingRunner     update.Runner
	PendingTargetName string
	PendingApps       []string

	Resuming bool
	// contains filtered or unexported fields
}

Atributes of the UpdateContext instance are gradually set during the update process

type UpdateOptions

type UpdateOptions struct {
	EnableTuf bool
	TargetId  string

	DoCheck   bool
	DoFetch   bool
	DoInstall bool
	DoStart   bool
}

Jump to

Keyboard shortcuts

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