cnabprovider

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 29 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 {
	// Name of the instance.
	Claim string

	// Either a filepath to the bundle or the name of the bundle.
	BundlePath string

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

	// Params is the set of user-specified parameter values to pass to the bundle.
	Params map[string]string

	// Either a filepath to a credential file or the name of a set of a credentials.
	CredentialIdentifiers []string

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

	// Path to an optional relocation mapping file
	RelocationMapping string

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

Shared arguments for all CNAB actions

type CNABProvider

type CNABProvider interface {
	LoadBundle(bundleFile string) (*bundle.Bundle, error)
	Install(arguments ActionArguments) error
	Upgrade(arguments ActionArguments) error
	Invoke(action string, arguments ActionArguments) error
	Uninstall(arguments ActionArguments) error
}

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

type Runtime

type Runtime struct {
	*config.Config

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

func NewRuntime

func NewRuntime(c *config.Config, claims claims.ClaimProvider, credentials credentials.CredentialProvider, parameters parameters.ParameterProvider) *Runtime

func (*Runtime) AddFiles

func (*Runtime) AddRelocation

func (d *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 (d *Runtime) ApplyConfig(args ActionArguments) action.OperationConfigs

func (*Runtime) Install

func (d *Runtime) Install(args ActionArguments) error

func (*Runtime) Invoke

func (d *Runtime) Invoke(action string, args ActionArguments) error

func (*Runtime) LoadBundle

func (d *Runtime) LoadBundle(bundleFile string) (*bundle.Bundle, error)

func (*Runtime) SetOutput

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

func (*Runtime) Uninstall

func (d *Runtime) Uninstall(args ActionArguments) error

func (*Runtime) Upgrade

func (d *Runtime) Upgrade(args ActionArguments) error

type TestRuntime

type TestRuntime struct {
	*Runtime
	TestCredentials credentials.TestCredentialProvider
	TestParameters  *parameters.TestParameterProvider
	TestConfig      *config.TestConfig
}

func NewTestRuntime

func NewTestRuntime(t *testing.T) *TestRuntime

func NewTestRuntimeWithConfig

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

func (*TestRuntime) Install

func (t *TestRuntime) Install(args ActionArguments) error

func (*TestRuntime) Invoke

func (t *TestRuntime) Invoke(action string, args ActionArguments) error

func (*TestRuntime) LoadBundle

func (t *TestRuntime) LoadBundle(bundleFile string) (*bundle.Bundle, error)

func (*TestRuntime) Uninstall

func (t *TestRuntime) Uninstall(args ActionArguments) error

func (*TestRuntime) Upgrade

func (t *TestRuntime) Upgrade(args ActionArguments) error

Jump to

Keyboard shortcuts

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