runtime

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: 30 Imported by: 12

Documentation

Index

Constants

View Source
const (
	BundleDependenciesDir = "/cnab/app/dependencies"
)

Variables

This section is empty.

Functions

func GetDependencyDefinition

func GetDependencyDefinition(c *portercontext.Context, alias string) ([]byte, error)

func GetDependencyDefinitionPath

func GetDependencyDefinitionPath(alias string) string

Types

type ActionInput

type ActionInput struct {
	Steps []*manifest.Step `yaml:"steps"`
	// contains filtered or unexported fields
}

func (*ActionInput) MarshalYAML

func (a *ActionInput) MarshalYAML() (interface{}, error)

MarshalYAML marshals the step nested under the action install:

  • helm3: ...

Solution from https://stackoverflow.com/a/42547226

type PorterRuntime

type PorterRuntime struct {
	RuntimeManifest *RuntimeManifest
	// contains filtered or unexported fields
}

PorterRuntime orchestrates executing a bundle and managing state.

func NewPorterRuntime

func NewPorterRuntime(runtimeCfg RuntimeConfig, mixins pkgmgmt.PackageManager) *PorterRuntime

func (*PorterRuntime) Execute

func (r *PorterRuntime) Execute(ctx context.Context, rm *RuntimeManifest) error

func (*PorterRuntime) NewRuntimeManifest added in v1.0.1

func (r *PorterRuntime) NewRuntimeManifest(action string, m *manifest.Manifest) *RuntimeManifest

type RuntimeConfig added in v1.0.1

type RuntimeConfig struct {
	*portercontext.Context

	// DebugMode indicates if the bundle is running in debug mode.
	DebugMode bool
}

RuntimeConfig is a specialized portercontext.Context with additional runtime-specific settings.

func NewConfig added in v1.0.1

func NewConfig() RuntimeConfig

NewConfig returns an initialized RuntimeConfig

func NewConfigFor added in v1.0.1

func NewConfigFor(porterCtx *portercontext.Context) RuntimeConfig

NewConfigFor returns an initialized RuntimeConfig using the specified context.

func (RuntimeConfig) ConfigureLogging added in v1.0.1

func (c RuntimeConfig) ConfigureLogging(ctx context.Context) (context.Context, error)

type RuntimeManifest

type RuntimeManifest struct {
	*manifest.Manifest

	Action string
	// contains filtered or unexported fields
}

func NewRuntimeManifest

func NewRuntimeManifest(cfg RuntimeConfig, action string, manifest *manifest.Manifest) *RuntimeManifest

func (*RuntimeManifest) ApplyStepOutputs

func (m *RuntimeManifest) ApplyStepOutputs(assignments map[string]string) error

func (*RuntimeManifest) Finalize added in v1.0.1

func (m *RuntimeManifest) Finalize(ctx context.Context) error

Finalize cleans up the bundle before its completion.

func (*RuntimeManifest) GetInstallationName added in v0.29.1

func (m *RuntimeManifest) GetInstallationName() string

func (*RuntimeManifest) GetInstallationNamespace added in v1.0.1

func (m *RuntimeManifest) GetInstallationNamespace() string

func (*RuntimeManifest) GetOutputs

func (m *RuntimeManifest) GetOutputs() map[string]string

func (*RuntimeManifest) GetSensitiveValues

func (m *RuntimeManifest) GetSensitiveValues() []string

func (*RuntimeManifest) GetSteps

func (m *RuntimeManifest) GetSteps() manifest.Steps

func (*RuntimeManifest) Initialize added in v1.0.1

func (m *RuntimeManifest) Initialize(ctx context.Context) error

Initialize prepares the runtime environment prior to step execution

func (*RuntimeManifest) ReadDependencyOutputValue added in v0.28.0

func (m *RuntimeManifest) ReadDependencyOutputValue(ref manifest.DependencyOutputReference) (string, error)

ReadDependencyOutputValue reads the dependency's output using the alias for the dependency from the specified output parameter source (name).

func (*RuntimeManifest) ResolveImages

func (m *RuntimeManifest) ResolveImages(bun cnab.ExtendedBundle, reloMap relocation.ImageRelocationMap) error

ResolveImages updates the RuntimeManifest to properly reflect the image map passed to the bundle via the mounted bundle.json and relocation mapping

func (*RuntimeManifest) ResolveInvocationImage added in v1.0.1

func (m *RuntimeManifest) ResolveInvocationImage(bun cnab.ExtendedBundle, reloMap relocation.ImageRelocationMap) error

ResolveInvocationImage updates the RuntimeManifest to properly reflect the invocation image passed to the bundle via the mounted bundle.json and relocation mapping

func (*RuntimeManifest) ResolveStep

func (m *RuntimeManifest) ResolveStep(ctx context.Context, stepIndex int, step *manifest.Step) error

ResolveStep will walk through the Step's data and resolve any placeholder data using the definitions in the manifest, like parameters or credentials.

func (*RuntimeManifest) Validate

func (m *RuntimeManifest) Validate() error

type StepOutput

type StepOutput struct {
	Name string                 `yaml:"name"`
	Data map[string]interface{} `yaml:",inline"`
	// contains filtered or unexported fields
}

type TestPorterRuntime

type TestPorterRuntime struct {
	*PorterRuntime
	TestContext *portercontext.TestContext
}

func NewTestPorterRuntime

func NewTestPorterRuntime(t *testing.T) *TestPorterRuntime

type TestRuntimeConfig added in v1.0.1

type TestRuntimeConfig struct {
	RuntimeConfig
	TestContext *portercontext.TestContext
}

func NewTestRuntimeConfig added in v1.0.1

func NewTestRuntimeConfig(t *testing.T) TestRuntimeConfig

Jump to

Keyboard shortcuts

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