Documentation ¶
Index ¶
- Constants
- func IsInvalidActionError(err error) bool
- func IsSupportedAction(value string) bool
- type Action
- type BundleConnection
- type BundleOutput
- type Config
- func (c *Config) GetBundleDir(bundle string) (string, error)
- func (c *Config) GetBundleManifestPath(bundle string) (string, error)
- func (c *Config) GetBundlesCache() (string, error)
- func (c *Config) GetCredentialPath(name string) (string, error)
- func (c *Config) GetCredentialsDir() (string, error)
- func (c *Config) GetHomeDir() (string, error)
- func (c *Config) GetMixinDir(mixin string) (string, error)
- func (c *Config) GetMixinPath(mixin string) (string, error)
- func (c *Config) GetMixinRuntimePath(mixin string) (string, error)
- func (c *Config) GetMixinsDir() (string, error)
- func (c *Config) GetPorterPath() (string, error)
- func (c *Config) GetPorterRuntimePath() (string, error)
- func (c *Config) LoadDependencies() error
- func (c *Config) LoadManifest() error
- func (c *Config) LoadManifestFrom(file string) error
- func (c *Config) ReadManifest(path string) (*Manifest, error)
- func (c *Config) SetHomeDir(home string)
- type CredentialDefinition
- type Dependency
- type ImagePlatform
- type Location
- type Manifest
- func (m *Manifest) ApplyOutputs(step *Step, assignments []string) error
- func (m *Manifest) GetManifestDir() string
- func (m *Manifest) GetManifestPath() string
- func (m *Manifest) GetSensitiveValues() []string
- func (m *Manifest) GetSteps(action Action) (Steps, error)
- func (m *Manifest) MergeDependency(dep *Dependency) error
- func (m *Manifest) MergeInstall(dep *Dependency)
- func (m *Manifest) MergeParameters(dep *Dependency) error
- func (m *Manifest) MergeUninstall(dep *Dependency)
- func (m *Manifest) MergeUpgrade(dep *Dependency)
- func (m *Manifest) ResolveStep(step *Step) error
- func (m *Manifest) Validate() error
- type MappedImage
- type ParameterDefinition
- type ParameterMetadata
- type Step
- type StepOutput
- type Steps
- type TestConfig
Constants ¶
const ( ActionInstall Action = "install" ActionUpgrade Action = "upgrade" ActionUninstall Action = "uninstall" ErrInvalidAction string = "invalid action" )
const ( // Name is the file name of the porter configuration file. Name = "porter.yaml" // RunScript is the path to the CNAB run script. RunScript = "cnab/app/run" // EnvHOME is the name of the environment variable containing the porter home directory path. EnvHOME = "PORTER_HOME" // EnvACTION is the request EnvACTION = "CNAB_ACTION" // EnvDEBUG is a custom porter parameter that signals that --debug flag has been passed through from the client to the runtime. EnvDEBUG = "PORTER_DEBUG" CustomBundleKey = "sh.porter" )
Variables ¶
This section is empty.
Functions ¶
func IsInvalidActionError ¶
IsInvalidActionError determines if an error is the error returned by ParseAction when a value isn't a valid action.
func IsSupportedAction ¶
IsSupportedAction determines if the value is an action supported by Porter.
Types ¶
type Action ¶
type Action string
func GetSupportActions ¶
func GetSupportActions() []Action
func ParseAction ¶
ParseAction converts a string into an Action, or returns an error message.
type BundleConnection ¶
type BundleOutput ¶
type Config ¶
type Config struct { *context.Context Manifest *Manifest // contains filtered or unexported fields }
func (*Config) GetBundleDir ¶
GetBundleDir locates a bundle Lookup order: - ./bundles/ - PORTER_HOME/bundles/
func (*Config) GetBundleManifestPath ¶
GetBundleManifest gets the path to another bundle's manifest.
func (*Config) GetBundlesCache ¶
GetBundlesDir locates the bundle cache from the porter home directory.
func (*Config) GetCredentialsDir ¶
func (*Config) GetHomeDir ¶
GetHomeDir determines the path to the porter home directory.
func (*Config) GetMixinRuntimePath ¶
func (*Config) GetMixinsDir ¶
func (*Config) GetPorterPath ¶
func (*Config) GetPorterRuntimePath ¶
func (*Config) LoadDependencies ¶
func (*Config) LoadManifest ¶
func (*Config) LoadManifestFrom ¶
func (*Config) ReadManifest ¶
ReadManifest determines if specified path is a URL or a filepath. After reading the data in the path it returns a Manifest and any errors
func (*Config) SetHomeDir ¶
type CredentialDefinition ¶
type Dependency ¶
type Dependency struct { Name string `yaml:"name"` Parameters map[string]string `yaml:"parameters,omitempty"` Connections []BundleConnection `yaml:"connections",omitempty` // contains filtered or unexported fields }
func (*Dependency) Validate ¶
func (d *Dependency) Validate() error
type ImagePlatform ¶
type Manifest ¶
type Manifest struct { Name string `yaml:"name,omitempty"` Description string `yaml:"description,omitempty"` Version string `yaml:"version,omitempty"` // Image is the name of the invocation image in the format REGISTRY/NAME:TAG Image string `yaml:"invocationImage,omitempty"` // BundleTag is the name of the bundle in the format REGISTRY/NAME:TAG BundleTag string `yaml:"tag"` // Dockerfile is the relative path to the Dockerfile template for the invocation image Dockerfile string `yaml:"dockerfile,omitempty"` Mixins []string `yaml:"mixins,omitempty"` Install Steps `yaml:"install"` Uninstall Steps `yaml:"uninstall"` Upgrade Steps `yaml:"upgrade"` Parameters []ParameterDefinition `yaml:"parameters,omitempty"` Credentials []CredentialDefinition `yaml:"credentials,omitempty"` Dependencies []*Dependency `yaml:"dependencies,omitempty"` // ImageMap is a map of images referenced in the bundle. The mappings are mounted as a file at runtime to // /cnab/app/image-map.json. This data is not used by porter or any of the deislabs mixins, so only populate when you // plan on manually using this data in your own scripts. ImageMap map[string]MappedImage `yaml:"imageMap,omitempty"` // contains filtered or unexported fields }
func (*Manifest) ApplyOutputs ¶
func (*Manifest) GetManifestDir ¶
GetManifestDir returns the path to the directory that contains the manifest.
func (*Manifest) GetManifestPath ¶
GetManifestPath returns the path where the manifest was loaded. May be a URL.
func (*Manifest) GetSensitiveValues ¶
func (*Manifest) MergeDependency ¶
func (m *Manifest) MergeDependency(dep *Dependency) error
func (*Manifest) MergeInstall ¶
func (m *Manifest) MergeInstall(dep *Dependency)
func (*Manifest) MergeParameters ¶
func (m *Manifest) MergeParameters(dep *Dependency) error
func (*Manifest) MergeUninstall ¶
func (m *Manifest) MergeUninstall(dep *Dependency)
func (*Manifest) MergeUpgrade ¶
func (m *Manifest) MergeUpgrade(dep *Dependency)
func (*Manifest) ResolveStep ¶
ResolveStep will walk through the Step's data and resolve any placeholder data using the definitions in the manifest, like parameters or credentials.
type MappedImage ¶
type MappedImage struct { Description string `yaml:"description"` ImageType string `yaml:"imageType"` Image string `yaml:"image"` OriginalImage string `yaml:"originalImage,omitempty"` Digest string `yaml:"digest,omitempty"` Size uint64 `yaml:"size,omitempty"` MediaType string `yaml:"mediaType,omitempty"` Platform *ImagePlatform `yaml:"platform,omitempty"` }
type ParameterDefinition ¶
type ParameterDefinition struct { Name string `yaml:"name"` DataType string `yaml:"type"` Default interface{} `yaml:"default,omitempty"` AllowedValues []interface{} `yaml:"allowed,omitempty"` Required bool `yaml:"required"` MinValue *int `yaml:"minValue,omitempty"` MaxValue *int `yaml:"maxValue,omitempty"` MinLength *int `yaml:"minLength,omitempty"` MaxLength *int `yaml:"maxLength,omitempty"` Metadata ParameterMetadata `yaml:"metadata,omitempty"` Destination *Location `yaml:"destination,omitempty"` Sensitive bool `yaml:"sensitive"` }
ParameterDefinition defines a single parameter for a CNAB bundle
type ParameterMetadata ¶
type ParameterMetadata struct {
Description string `yaml:"description,omitempty"`
}
ParameterMetadata contains metadata for a parameter definition.
type Step ¶
type Step struct { Data map[string]interface{} `yaml:",inline"` // contains filtered or unexported fields }
func (*Step) GetDescription ¶
GetDescription returns a description of the step. Every step must have this property.
func (*Step) GetMixinName ¶
type StepOutput ¶
type TestConfig ¶
type TestConfig struct { *Config TestContext *context.TestContext }
func NewTestConfig ¶
func NewTestConfig(t *testing.T) *TestConfig
NewTestConfig initializes a configuration suitable for testing, with the output buffered, and an in-memory file system.
func (*TestConfig) SetupIntegrationTest ¶
func (c *TestConfig) SetupIntegrationTest(home string)
InitializePorterHome initializes the filesystem with the supporting files in the PORTER_HOME directory.
func (*TestConfig) SetupPorterHome ¶
func (c *TestConfig) SetupPorterHome()
InitializePorterHome initializes the test filesystem with the supporting files in the PORTER_HOME directory.