cnabprovider

package
v1.0.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 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 claims.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

	// 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(arguments ActionArguments) error
}

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

type Runtime

type Runtime struct {
	*config.Config

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

func NewRuntime

func NewRuntime(c *config.Config, claims claims.Provider, credentials credentials.Provider) *Runtime

func (*Runtime) AddFiles

func (*Runtime) AddRelocation

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

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

func (*Runtime) ApplyConfig

func (r *Runtime) ApplyConfig(args ActionArguments) action.OperationConfigs

func (*Runtime) Execute added in v0.28.0

func (r *Runtime) Execute(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(b cnab.ExtendedBundle) (cnab.ExtendedBundle, error)

func (*Runtime) ProcessBundleFromFile added in v0.38.5

func (r *Runtime) ProcessBundleFromFile(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(opResult driver.OperationResult, installation claims.Installation, run claims.Run, result claims.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(installation claims.Installation, run claims.Run, status string) error

SaveRun with the specified status.

func (*Runtime) SetOutput

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

type TestRuntime

type TestRuntime struct {
	*Runtime
	TestStorage     storage.TestStore
	TestClaims      *claims.TestClaimProvider
	TestCredentials *credentials.TestCredentialProvider
	TestParameters  *parameters.TestParameterProvider
	TestConfig      *config.TestConfig
}

func NewTestRuntime

func NewTestRuntime(t *testing.T) *TestRuntime

func NewTestRuntimeFor added in v1.0.1

func NewTestRuntimeFor(tc *config.TestConfig, testClaims *claims.TestClaimProvider, testCredentials *credentials.TestCredentialProvider, testParameters *parameters.TestParameterProvider) *TestRuntime

func (*TestRuntime) Execute added in v0.28.0

func (t *TestRuntime) Execute(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) Teardown

func (t *TestRuntime) Teardown() error

Jump to

Keyboard shortcuts

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