provider

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppTypeLabel            = "appType"
	DefaultImageManifestDir = "/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationSpec

type ApplicationSpec struct {
	// Name of the application
	Name string
	// ID of the application
	ID string
	// Type of the application
	AppType v1alpha1.AppType
	// Path to the application
	Path string
	// EnvVars are the environment variables to be passed to the application
	EnvVars map[string]string
	// Embedded is true if the application is embedded in the device
	Embedded bool
	// ImageProvider is the spec for the image provider
	ImageProvider *v1alpha1.ImageApplicationProviderSpec
	// InlineProvider is the spec for the inline provider
	InlineProvider *v1alpha1.InlineApplicationProviderSpec
}

type Diff

type Diff struct {
	// Ensure contains both newly added and unchanged app provders
	Ensure []Provider
	// Removed contains app providers that are no longer part of the desired state
	Removed []Provider
	// Changed contains app providers that have changed between the current and desired state
	Changed []Provider
}

func GetDiff

func GetDiff(
	current []Provider,
	desired []Provider,
) (Diff, error)

type ParseOpt

type ParseOpt func(*parseConfig)

func WithEmbedded

func WithEmbedded() ParseOpt

func WithProviderTypes

func WithProviderTypes(providerTypes ...v1alpha1.ApplicationProviderType) ParseOpt

type Provider

type Provider interface {
	// Verify the application content is valid and dependencies are met.
	Verify(ctx context.Context) error
	// Install the application content to the device.
	Install(ctx context.Context) error
	// Remove the application content from the device.
	Remove(ctx context.Context) error
	// Name returns the name of the application.
	Name() string
	// Spec returns the application spec.
	Spec() *ApplicationSpec
}

Provider defines the interface for supplying and managing an application's spec and lifecycle operations for installation to disk.

func FromDeviceSpec

func FromDeviceSpec(
	ctx context.Context,
	log *log.PrefixLogger,
	podman *client.Podman,
	readWriter fileio.ReadWriter,
	spec *v1alpha1.DeviceSpec,
	opts ...ParseOpt,
) ([]Provider, error)

FromDeviceSpec parses the application spec and returns a list of providers.

Jump to

Keyboard shortcuts

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