cnabprovider

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DriverNameDocker is the name of the CNAB Docker driver.
	DriverNameDocker = "docker"

	// DriverNameDebug is the name of the CNAB debug driver.
	DriverNameDebug = "debug"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionArguments

type ActionArguments struct {
	// Action to execute, e.g. install, upgrade.
	Action string

	// Name of the installation.
	Installation storage.Installation

	// BundleReference is the set of information necessary to execute a bundle.
	BundleReference cnab.BundleReference

	// Additional files to copy into the bundle
	// Target Path => File Contents
	Files map[string]string

	// Params is the fully resolved set of parameters.
	Params map[string]interface{}

	// Driver is the CNAB-compliant driver used to run bundle actions.
	Driver string

	// Give the bundle privileged access to the docker daemon.
	AllowDockerHostAccess bool

	// MountHostVolumes is a map of host paths to container paths to mount.
	HostVolumeMounts []HostVolumeMountSpec

	// PersistLogs specifies if the invocation image output should be saved as an output.
	PersistLogs bool
}

Shared arguments for all CNAB actions

type CNABProvider

type CNABProvider interface {
	LoadBundle(bundleFile string) (cnab.ExtendedBundle, error)
	Execute(ctx context.Context, arguments ActionArguments) error
}

CNABProvider is the interface Porter uses to communicate with the CNAB runtime

type HostVolumeMountSpec added in v1.0.17

type HostVolumeMountSpec struct {
	Source   string
	Target   string
	ReadOnly bool
}

type Runtime

type Runtime struct {
	*config.Config

	Extensions cnab.ProcessedExtensions
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(c *config.Config, installations storage.InstallationProvider, credentials storage.CredentialSetProvider, secrets secrets.Store, sanitizer *storage.Sanitizer) *Runtime

func (*Runtime) AddEnvironment added in v1.0.1

func (r *Runtime) AddEnvironment(args ActionArguments) cnabaction.OperationConfigFunc

func (*Runtime) AddFiles

func (*Runtime) AddRelocation

func (r *Runtime) AddRelocation(args ActionArguments) cnabaction.OperationConfigFunc

AddRelocation operates on an ActionArguments and adds any provided relocation mapping to the operation's files.

func (*Runtime) ApplyConfig

func (*Runtime) CreateRun added in v1.0.1

func (r *Runtime) CreateRun(ctx context.Context, args ActionArguments, b cnab.ExtendedBundle) (storage.Run, error)

func (*Runtime) Execute added in v0.28.0

func (r *Runtime) Execute(ctx context.Context, args ActionArguments) error

func (*Runtime) LoadBundle

func (r *Runtime) LoadBundle(bundleFile string) (cnab.ExtendedBundle, error)

func (*Runtime) ProcessBundle added in v0.28.0

func (r *Runtime) ProcessBundle(ctx context.Context, b cnab.ExtendedBundle) (cnab.ExtendedBundle, error)

func (*Runtime) ProcessBundleFromFile added in v0.38.5

func (r *Runtime) ProcessBundleFromFile(ctx context.Context, bundleFile string) (cnab.ExtendedBundle, error)

func (*Runtime) ProcessRequiredExtensions added in v0.28.0

func (r *Runtime) ProcessRequiredExtensions(b cnab.ExtendedBundle) error

func (*Runtime) SaveOperationResult added in v1.0.1

func (r *Runtime) SaveOperationResult(ctx context.Context, opResult driver.OperationResult, installation storage.Installation, run storage.Run, result storage.Result) error

SaveOperationResult saves the ClaimResult and Outputs. The caller is responsible for having already persisted the claim itself, for example using SaveRun.

func (*Runtime) SaveRun added in v1.0.1

func (r *Runtime) SaveRun(ctx context.Context, installation storage.Installation, run storage.Run, status string) error

SaveRun with the specified status.

func (*Runtime) SetOutput

func (r *Runtime) SetOutput() cnabaction.OperationConfigFunc

type TestRuntime

type TestRuntime struct {
	*Runtime
	TestStorage       storage.TestStore
	TestInstallations *storage.TestInstallationProvider
	TestCredentials   *storage.TestCredentialSetProvider
	TestParameters    *storage.TestParameterSetProvider
	TestConfig        *config.TestConfig
}

func NewTestRuntime

func NewTestRuntime(t *testing.T) *TestRuntime

func NewTestRuntimeFor added in v1.0.1

func NewTestRuntimeFor(tc *config.TestConfig, testInstallations *storage.TestInstallationProvider, testCredentials *storage.TestCredentialSetProvider, testParameters *storage.TestParameterSetProvider, testSecrets secrets.Store) *TestRuntime

func (*TestRuntime) Close added in v1.0.1

func (t *TestRuntime) Close() error

func (*TestRuntime) Execute added in v0.28.0

func (t *TestRuntime) Execute(ctx context.Context, args ActionArguments) error

func (*TestRuntime) LoadBundle

func (t *TestRuntime) LoadBundle(bundleFile string) (cnab.ExtendedBundle, error)

func (*TestRuntime) LoadTestBundle added in v1.0.1

func (t *TestRuntime) LoadTestBundle(bundleFile string) cnab.ExtendedBundle

func (*TestRuntime) MockGetDockerGroupId added in v1.0.1

func (t *TestRuntime) MockGetDockerGroupId()

Jump to

Keyboard shortcuts

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