updatesource

package
v0.0.0-...-7cac148 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUpdateNotAvailable = status.New(status.UpdateExecError, "A chef-automate CLI is not available")

ErrUpdateNotAvailable is returned when no versions are available

Functions

This section is empty.

Types

type UpdateSource

type UpdateSource interface {
	// DesiredVersion returns the version the update source thinks we should be
	// running
	DesiredVersion(ctx context.Context) (string, error)
	// FetchLatest returns the binary for the latest executable along with the
	// version. Because of time, the version returned in DesiredVersion can end
	// up being different than what FetchLatest says the version is.
	FetchLatest(ctx context.Context) ([]byte, string, error)
}

UpdateSource describes a place where we can get a version and executable

func DeploymentService

func DeploymentService(cliUpdaterClient api.DeploymentClient) UpdateSource

DeploymentService returns an UpdateSource that knows how to fetch the desired version and executable binary from the deployment-service

func Local

func Local(executableCache executablecache.ExecutableCache) UpdateSource

Local returns an UpdateSource that only knows how to check for available updates that are locally cached using the ExecutableCache. This UpdateSource is used for making sure we start off by running the latest executable we have

Jump to

Keyboard shortcuts

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