Documentation ¶
Index ¶
- Constants
- Variables
- type ApplyOptions
- type ArchiveOptions
- type BuildOptions
- type BundleAction
- type BundleExecutionOptions
- type BundlePullOptions
- type BundleReferenceOptions
- type BundleResolver
- type CopyOpts
- type CredentialCreateOptions
- type CredentialDeleteOptions
- type CredentialEditOptions
- type CredentialOptions
- type CredentialShowOptions
- type DeleteOptions
- type DisplayCredentialSet
- type DisplayInstallation
- type DisplayInstallationMetadata
- type DisplayInstallations
- type DisplayParameterSet
- type DisplayRun
- type DisplayRuns
- type DisplayValue
- type DisplayValues
- type ExplainOpts
- type InspectableBundle
- type InstallOptions
- type InternalPlugin
- type InvokeOptions
- type LintOptions
- type ListOptions
- type LogsShowOptions
- type MigrateStorageOptions
- type Mixins
- type MixinsCreateOptions
- type OutputListOptions
- type OutputShowOptions
- type ParameterCreateOptions
- type ParameterDeleteOptions
- type ParameterEditOptions
- type ParameterOptions
- type ParameterShowOptions
- type Porter
- func (p *Porter) Archive(ctx context.Context, opts ArchiveOptions) error
- func (p *Porter) Build(ctx context.Context, opts BuildOptions) error
- func (p *Porter) BuildActionArgs(ctx context.Context, installation storage.Installation, action BundleAction) (cnabprovider.ActionArguments, error)
- func (p *Porter) Close() error
- func (p *Porter) Connect(ctx context.Context) error
- func (p *Porter) CopyBundle(ctx context.Context, opts *CopyOpts) error
- func (p *Porter) CopyTemplate(getTemplate func() ([]byte, error), dest string) error
- func (p *Porter) Create() error
- func (p *Porter) CreateCredential(ctx context.Context, opts CredentialCreateOptions) error
- func (p *Porter) CreateMixin(opts MixinsCreateOptions) error
- func (p *Porter) CreateMixinFeedTemplate() error
- func (p *Porter) CreateParameter(opts ParameterCreateOptions) error
- func (p *Porter) CredentialsApply(ctx context.Context, o ApplyOptions) error
- func (p *Porter) DeleteCredential(ctx context.Context, opts CredentialDeleteOptions) error
- func (p *Porter) DeleteInstallation(ctx context.Context, opts DeleteOptions) error
- func (p *Porter) DeleteParameter(ctx context.Context, opts ParameterDeleteOptions) error
- func (p *Porter) EditCredential(ctx context.Context, opts CredentialEditOptions) error
- func (p *Porter) EditParameter(ctx context.Context, opts ParameterEditOptions) error
- func (p *Porter) ExecuteAction(ctx context.Context, installation storage.Installation, action BundleAction) error
- func (p *Porter) Explain(ctx context.Context, o ExplainOpts) error
- func (p *Porter) FixPermissions(ctx context.Context) error
- func (p *Porter) GenerateCredentials(ctx context.Context, opts CredentialOptions) error
- func (p *Porter) GenerateMixinFeed(ctx context.Context, opts feed.GenerateOptions) error
- func (p *Porter) GenerateParameters(ctx context.Context, opts ParameterOptions) error
- func (p *Porter) GetBuilder(ctx context.Context) build.Builder
- func (p *Porter) GetInstallation(ctx context.Context, opts ShowOptions) (storage.Installation, *storage.Run, error)
- func (p *Porter) GetInstallationLogs(ctx context.Context, opts *LogsShowOptions) (string, bool, error)
- func (p *Porter) GetManifestSchema(ctx context.Context) (jsonSchema, error)
- func (p *Porter) GetPlugin(ctx context.Context, name string) (*plugins.Metadata, error)
- func (p *Porter) GetReplacementSchema() (jsonSchema, error)
- func (p *Porter) Inspect(ctx context.Context, o ExplainOpts) error
- func (p *Porter) InstallBundle(ctx context.Context, opts InstallOptions) error
- func (p *Porter) InstallMixin(ctx context.Context, opts mixin.InstallOptions) error
- func (p *Porter) InstallPlugin(ctx context.Context, opts plugins.InstallOptions) error
- func (p *Porter) InstallationApply(ctx context.Context, opts ApplyOptions) error
- func (p *Porter) InvokeBundle(ctx context.Context, opts InvokeOptions) error
- func (p *Porter) IsBundleUpToDate(ctx context.Context, opts bundleFileOptions) (bool, error)
- func (p *Porter) IsInstallationInSync(ctx context.Context, i storage.Installation, lastRun *storage.Run, ...) (bool, error)
- func (p *Porter) Lint(ctx context.Context, opts LintOptions) (linter.Results, error)
- func (p *Porter) ListBundleOutputs(ctx context.Context, opts *OutputListOptions) (DisplayValues, error)
- func (p *Porter) ListCredentials(ctx context.Context, opts ListOptions) ([]storage.CredentialSet, error)
- func (p *Porter) ListInstallationRuns(ctx context.Context, opts RunListOptions) (DisplayRuns, error)
- func (p *Porter) ListInstallations(ctx context.Context, opts ListOptions) (DisplayInstallations, error)
- func (p *Porter) ListMixins(ctx context.Context) ([]mixin.Metadata, error)
- func (p *Porter) ListParameters(ctx context.Context, opts ListOptions) ([]storage.ParameterSet, error)
- func (p *Porter) ListPlugins(ctx context.Context) ([]plugins.Metadata, error)
- func (p *Porter) MigrateStorage(ctx context.Context, opts MigrateStorageOptions) error
- func (p *Porter) NewDisplayInstallationWithSecrets(ctx context.Context, installation storage.Installation, run *storage.Run) (DisplayInstallation, error)
- func (p *Porter) ParametersApply(ctx context.Context, o ApplyOptions) error
- func (p *Porter) PrintBundleOutputs(ctx context.Context, opts OutputListOptions) error
- func (p *Porter) PrintCredentials(ctx context.Context, opts ListOptions) error
- func (p *Porter) PrintDebugInfo(ctx context.Context, opts VersionOpts, metadata pkgmgmt.Metadata) error
- func (p *Porter) PrintInstallationRuns(ctx context.Context, opts RunListOptions) error
- func (p *Porter) PrintInstallations(ctx context.Context, opts ListOptions) error
- func (p *Porter) PrintLintResults(ctx context.Context, opts LintOptions) error
- func (p *Porter) PrintManifestSchema(ctx context.Context) error
- func (p *Porter) PrintMixins(ctx context.Context, opts PrintMixinsOptions) error
- func (p *Porter) PrintPackages(opts SearchOptions, list pkgmgmt.PackageList) error
- func (p *Porter) PrintParameters(ctx context.Context, opts ListOptions) error
- func (p *Porter) PrintPlugins(ctx context.Context, opts PrintPluginsOptions) error
- func (p *Porter) PrintVersion(ctx context.Context, opts VersionOpts) error
- func (p *Porter) Publish(ctx context.Context, opts PublishOptions) error
- func (p *Porter) PullBundle(ctx context.Context, opts BundlePullOptions) (cache.CachedBundle, error)
- func (p *Porter) ReadBundleOutput(ctx context.Context, outputName, installation, namespace string) (string, error)
- func (p *Porter) ReconcileInstallation(ctx context.Context, opts ReconcileOptions) error
- func (p *Porter) Run(ctx context.Context, opts RunOptions) error
- func (p *Porter) RunInternalPlugins(ctx context.Context, opts RunInternalPluginOpts) (err error)
- func (p *Porter) SearchPackages(opts SearchOptions) error
- func (p *Porter) ShowBundleOutput(ctx context.Context, opts *OutputShowOptions) error
- func (p *Porter) ShowCredential(ctx context.Context, opts CredentialShowOptions) error
- func (p *Porter) ShowInstallation(ctx context.Context, opts ShowOptions) error
- func (p *Porter) ShowInstallationLogs(ctx context.Context, opts *LogsShowOptions) error
- func (p *Porter) ShowParameter(ctx context.Context, opts ParameterShowOptions) error
- func (p *Porter) ShowPlugin(ctx context.Context, opts ShowPluginOptions) error
- func (p *Porter) UninstallBundle(ctx context.Context, opts UninstallOptions) error
- func (p *Porter) UninstallMixin(ctx context.Context, opts pkgmgmt.UninstallOptions) error
- func (p *Porter) UninstallPlugin(ctx context.Context, opts pkgmgmt.UninstallOptions) error
- func (p *Porter) UpgradeBundle(ctx context.Context, opts *UpgradeOptions) error
- type PrintMixinsOptions
- type PrintPluginsOptions
- type PrintableAction
- type PrintableBundle
- type PrintableCredential
- type PrintableDependency
- type PrintableImage
- type PrintableInvocationImage
- type PrintableOutput
- type PrintableParameter
- type PublishOptions
- type ReconcileOptions
- type RunInternalPluginOpts
- type RunListOptions
- type RunOptions
- type SearchOptions
- type ShowOptions
- type ShowPluginOptions
- type SortPrintableAction
- type SortPrintableCredential
- type SortPrintableOutput
- type SortPrintableParameter
- type SystemDebugInfo
- type SystemInfo
- type TestBuildProvider
- type TestDriver
- type TestPorter
- func (p *TestPorter) AddTestBundleDir(bundleDir string, generateUniqueName bool) string
- func (p *TestPorter) AddTestDriver(driver TestDriver) string
- func (p *TestPorter) AddTestFile(src string, dest string)
- func (p *TestPorter) Close() error
- func (p *TestPorter) CompareGoldenFile(goldenFile string, got string)
- func (p *TestPorter) CreateBundleDir() string
- func (p *TestPorter) CreateOutput(o storage.Output, bun cnab.ExtendedBundle) storage.Output
- func (p *TestPorter) RandomString(len int) string
- func (p *TestPorter) ReadBundle(path string) cnab.ExtendedBundle
- func (p *TestPorter) SanitizeParameters(raw []secrets.Strategy, recordID string, bun cnab.ExtendedBundle) []secrets.Strategy
- func (p *TestPorter) SetupIntegrationTest() context.Context
- func (p *TestPorter) T() *testing.T
- type UninstallDeleteOptions
- type UninstallOptions
- type UpgradeOptions
- type VersionOpts
Constants ¶
const ( // DockerDriver is the name of the Docker driver. DockerDriver = cnabprovider.DriverNameDocker // DebugDriver is the name of the Debug driver. DebugDriver = cnabprovider.DriverNameDebug // DefaultDriver is the name of the default driver (Docker). DefaultDriver = DockerDriver )
const ( StateInstalled = "installed" StateUninstalled = "uninstalled" StateDefined = "defined" StatusInstalling = "installing" StatusUninstalling = "uninstalling" StatusUpgrading = "upgrading" )
const ApplyDefaultFormat = printer.FormatPlaintext
const BuildDriverDefault = config.BuildDriverBuildkit
const (
SkeletorRepo = "https://github.com/getporter/skeletor"
)
Variables ¶
var ( // ErrUnsafeInstallationDelete warns the user that deletion of an unsuccessfully uninstalled installation is unsafe ErrUnsafeInstallationDelete = errors.New("it is unsafe to delete an installation when the last action wasn't a successful uninstall") // ErrUnsafeInstallationDeleteRetryForce presents the ErrUnsafeInstallationDelete error and provides a retry option of --force ErrUnsafeInstallationDeleteRetryForce = fmt.Errorf("%s; if you are sure it should be deleted, retry the last command with the --force flag", ErrUnsafeInstallationDelete) )
var ( LintAllowFormats = printer.Formats{printer.FormatPlaintext, printer.FormatJson} LintDefaultFormats = printer.FormatPlaintext )
var ( ShowAllowedFormats = []printer.Format{printer.FormatPlaintext, printer.FormatYaml, printer.FormatJson} ShowDefaultFormat = printer.FormatPlaintext )
var ApplyAllowedFormats = printer.Formats{printer.FormatPlaintext, printer.FormatYaml, printer.FormatJson}
var BuildDriverAllowedValues = []string{config.BuildDriverBuildkit}
var ErrUnsafeInstallationDeleteRetryForceDelete = fmt.Errorf("%s; if you are sure it should be deleted, retry the last command with the --force-delete flag", ErrUnsafeInstallationDelete)
ErrUnsafeInstallationDeleteRetryForceDelete presents the ErrUnsafeInstallationDelete error and provides a retry option of --force-delete
Functions ¶
This section is empty.
Types ¶
type ApplyOptions ¶ added in v1.0.1
type ApplyOptions struct { Namespace string File string // Force the installation to be re-applied regardless of anything being changed or not Force bool // DryRun only checks if the changes would trigger a bundle run DryRun bool }
func (*ApplyOptions) Validate ¶ added in v1.0.1
func (o *ApplyOptions) Validate(cxt *portercontext.Context, args []string) error
type ArchiveOptions ¶
type ArchiveOptions struct { BundleReferenceOptions ArchiveFile string }
ArchiveOptions defines the valid options for performing an archive operation
type BuildOptions ¶
type BuildOptions struct { build.BuildImageOptions // NoLint indicates if lint should be run before build. NoLint bool // Driver to use when building the invocation image. Driver string // Custom is the unparsed list of NAME=VALUE custom inputs set on the command line. Customs []string // contains filtered or unexported fields }
func (*BuildOptions) Validate ¶ added in v0.31.0
func (o *BuildOptions) Validate(p *Porter) error
type BundleAction ¶ added in v0.28.0
type BundleAction interface { // GetAction returns the type of action: install, upgrade, invoke, uninstall GetAction() string // GetActionVerb returns the appropriate verb (present participle, e.g. -ing) // for the action. GetActionVerb() string // GetOptions returns the common bundle action options used to execute the bundle. GetOptions() *BundleExecutionOptions // Validate the action before it is executed. Validate(ctx context.Context, args []string, p *Porter) error }
BundleAction is an interface that defines a method for supplying BundleLifecycleOptions. This is useful when implementations contain action-specific options beyond the stock BundleLifecycleOptions.
type BundleExecutionOptions ¶ added in v1.0.1
type BundleExecutionOptions struct { *BundleReferenceOptions // AllowDockerHostAccess grants the bundle access to the Docker socket. AllowDockerHostAccess bool // DebugMode indicates if the bundle should be run in debug mode. DebugMode bool // NoLogs runs the bundle without persisting any logs. NoLogs bool // Params is the unparsed list of NAME=VALUE parameters set on the command line. Params []string // ParameterSets is a list of parameter sets containing parameter sources ParameterSets []string // CredentialIdentifiers is a list of credential names or paths to make available to the bundle. CredentialIdentifiers []string // Driver is the CNAB-compliant driver used to run bundle actions. Driver string // contains filtered or unexported fields }
BundleExecutionOptions are common options for commands that run a bundle (install/upgrade/invoke/uninstall)
func NewBundleExecutionOptions ¶ added in v1.0.1
func NewBundleExecutionOptions() *BundleExecutionOptions
func (*BundleExecutionOptions) GetOptions ¶ added in v1.0.1
func (o *BundleExecutionOptions) GetOptions() *BundleExecutionOptions
func (*BundleExecutionOptions) LoadParameters ¶ added in v1.0.1
func (o *BundleExecutionOptions) LoadParameters(ctx context.Context, p *Porter, bun cnab.ExtendedBundle) error
LoadParameters validates and resolves the parameters and sets. It must be called after porter has loaded the bundle definition.
type BundlePullOptions ¶
type BundlePullOptions struct { Reference string InsecureRegistry bool Force bool // contains filtered or unexported fields }
func (*BundlePullOptions) GetReference ¶ added in v1.0.1
func (b *BundlePullOptions) GetReference() cnab.OCIReference
func (*BundlePullOptions) Validate ¶ added in v1.0.1
func (b *BundlePullOptions) Validate() error
type BundleReferenceOptions ¶ added in v1.0.1
type BundleReferenceOptions struct { BundlePullOptions // contains filtered or unexported fields }
BundleReferenceOptions are the set of options available for commands that accept a bundle reference
type BundleResolver ¶
type BundleResolver struct { Cache cache.BundleCache Registry cnabtooci.RegistryProvider }
func (*BundleResolver) Resolve ¶
func (r *BundleResolver) Resolve(ctx context.Context, opts BundlePullOptions) (cache.CachedBundle, error)
Resolves a bundle from the cache, or pulls it and caches it Returns the location of the bundle or an error
type CopyOpts ¶
type CredentialCreateOptions ¶ added in v1.0.1
CredentialCreateOptions represent options for Porter's credential create command
func (*CredentialCreateOptions) Validate ¶ added in v1.0.1
func (o *CredentialCreateOptions) Validate(args []string) error
type CredentialDeleteOptions ¶
CredentialDeleteOptions represent options for Porter's credential delete command
func (*CredentialDeleteOptions) Validate ¶
func (o *CredentialDeleteOptions) Validate(args []string) error
Validate validates the args provided Porter's credential delete command
type CredentialEditOptions ¶
func (*CredentialEditOptions) Validate ¶
func (o *CredentialEditOptions) Validate(args []string) error
Validate validates the args provided to Porter's credential edit command
type CredentialOptions ¶
type CredentialOptions struct { BundleReferenceOptions Silent bool Labels []string }
CredentialsOptions are the set of options available to Porter.GenerateCredentials
func (CredentialOptions) ParseLabels ¶ added in v1.0.1
func (o CredentialOptions) ParseLabels() map[string]string
type CredentialShowOptions ¶
type CredentialShowOptions struct { printer.PrintOptions Name string Namespace string }
CredentialShowOptions represent options for Porter's credential show command
func (*CredentialShowOptions) Validate ¶
func (o *CredentialShowOptions) Validate(args []string) error
Validate validates the args provided to Porter's credential show command
type DeleteOptions ¶ added in v0.28.0
type DeleteOptions struct { Force bool // contains filtered or unexported fields }
DeleteOptions represent options for Porter's installation delete command
func (*DeleteOptions) Validate ¶ added in v0.28.0
func (o *DeleteOptions) Validate(args []string, cxt *portercontext.Context) error
Validate prepares for an installation delete action and validates the args/options.
type DisplayCredentialSet ¶ added in v1.0.1
type DisplayCredentialSet struct { // SchemaType helps when we export the definition so editors can detect the type of document, it's not used by porter. SchemaType string `json:"schemaType" yaml:"schemaType"` storage.CredentialSet `yaml:",inline"` }
type DisplayInstallation ¶ added in v0.28.0
type DisplayInstallation struct { // SchemaType helps when we export the definition so editors can detect the type of document, it's not used by porter. SchemaType string `json:"schemaType" yaml:"schemaType" toml:"schemaType"` SchemaVersion schema.Version `json:"schemaVersion" yaml:"schemaVersion" toml:"schemaVersion"` ID string `json:"id" yaml:"id" toml:"id"` // Name of the installation. Immutable. Name string `json:"name" yaml:"name" toml:"name"` // Namespace in which the installation is defined. Namespace string `json:"namespace" yaml:"namespace" toml:"namespace"` // Uninstalled specifies if the installation isn't used anymore and should be uninstalled. Uninstalled bool `json:"uninstalled,omitempty" yaml:"uninstalled,omitempty" toml:"uninstalled,omitempty"` // Bundle specifies the bundle reference to use with the installation. Bundle storage.OCIReferenceParts `json:"bundle" yaml:"bundle" toml:"bundle"` // Custom extension data applicable to a given runtime. // TODO(carolynvs): remove and populate in ToCNAB when we firm up the spec Custom interface{} `json:"custom,omitempty" yaml:"custom,omitempty" toml:"custom,omitempty"` // Labels applied to the installation. Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty" toml:"labels,omitempty"` // CredentialSets that should be included when the bundle is reconciled. CredentialSets []string `json:"credentialSets,omitempty" yaml:"credentialSets,omitempty" toml:"credentialSets,omitempty"` // Parameters specified by the user through overrides. // Does not include defaults, or values resolved from parameter sources. Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty" toml:"parameters,omitempty"` // ParameterSets that should be included when the bundle is reconciled. ParameterSets []string `json:"parameterSets,omitempty" yaml:"parameterSets,omitempty" toml:"parameterSets,omitempty"` // Status of the installation. Status storage.InstallationStatus `json:"status,omitempty" yaml:"status,omitempty" toml:"status,omitempty"` DisplayInstallationMetadata `json:"_calculated" yaml:"_calculated"` }
DisplayInstallation holds a subset of pertinent values to be listed from installation data originating from its runs, results and outputs records
func NewDisplayInstallation ¶ added in v0.28.0
func NewDisplayInstallation(installation storage.Installation) DisplayInstallation
func (DisplayInstallation) ConvertParamToSet ¶ added in v1.0.1
func (d DisplayInstallation) ConvertParamToSet(i storage.Installation) (storage.ParameterSet, error)
ConvertParamToSet converts a Parameters into a internal ParameterSet.
func (DisplayInstallation) ConvertToInstallation ¶ added in v1.0.1
func (d DisplayInstallation) ConvertToInstallation() (storage.Installation, error)
ConvertToInstallationClaim transforms the data from DisplayInstallation into a Installation record.
type DisplayInstallationMetadata ¶ added in v1.0.1
type DisplayInstallationMetadata struct { ResolvedParameters DisplayValues `json:"resolvedParameters" yaml:"resolvedParameters"` // DisplayInstallationState is the latest state of the installation. // It is either "installed", "uninstalled", or "defined". DisplayInstallationState string `json:"displayInstallationState,omitempty" yaml:"displayInstallationState,omitempty" toml:"displayInstallationState,omitempty"` // DisplayInstallationStatus is the latest status of the installation. // It is either "succeeded, "failed", "installing", "uninstalling", "upgrading", or "running <custom action>" DisplayInstallationStatus string `` /* 128-byte string literal not displayed */ }
type DisplayInstallations ¶ added in v0.28.0
type DisplayInstallations []DisplayInstallation
TODO(carolynvs): be consistent with sorting results from list, either keep the default sort by name or update the other types to also sort by modified
func (DisplayInstallations) Len ¶ added in v0.28.0
func (l DisplayInstallations) Len() int
func (DisplayInstallations) Less ¶ added in v0.28.0
func (l DisplayInstallations) Less(i, j int) bool
func (DisplayInstallations) Swap ¶ added in v0.28.0
func (l DisplayInstallations) Swap(i, j int)
type DisplayParameterSet ¶ added in v1.0.1
type DisplayParameterSet struct { // SchemaType helps when we export the definition so editors can detect the type of document, it's not used by porter. SchemaType string `json:"schemaType" yaml:"schemaType"` storage.ParameterSet `yaml:",inline"` }
type DisplayRun ¶ added in v1.0.1
type DisplayRun struct { ID string `json:"id" yaml:"id"` Bundle string `json:"bundle,omitempty" yaml:"bundle,omitempty"` Version string `json:"version" yaml:"version"` Action string `json:"action" yaml:"action"` Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"` Started time.Time `json:"started" yaml:"started"` Stopped *time.Time `json:"stopped" yaml:"stopped"` Status string `json:"status" yaml:"status"` }
func NewDisplayRun ¶ added in v1.0.1
func NewDisplayRun(run storage.Run) DisplayRun
type DisplayRuns ¶ added in v1.0.1
type DisplayRuns []DisplayRun
func (DisplayRuns) Len ¶ added in v1.0.1
func (l DisplayRuns) Len() int
func (DisplayRuns) Less ¶ added in v1.0.1
func (l DisplayRuns) Less(i, j int) bool
func (DisplayRuns) Swap ¶ added in v1.0.1
func (l DisplayRuns) Swap(i, j int)
type DisplayValue ¶ added in v1.0.1
type DisplayValue struct { Name string `json:"name" yaml:"name"` Type string `json:"type" yaml:"type"` Sensitive bool `json:"sensitive" yaml:"sensitive"` Value interface{} `json:"value" yaml:"value"` }
func (DisplayValue) PrintValue ¶ added in v1.0.1
func (v DisplayValue) PrintValue() string
func (*DisplayValue) SetValue ¶ added in v1.0.1
func (v *DisplayValue) SetValue(value interface{})
type DisplayValues ¶ added in v1.0.1
type DisplayValues []DisplayValue
func NewDisplayValuesFromOutputs ¶ added in v1.0.1
func NewDisplayValuesFromOutputs(bun cnab.ExtendedBundle, outputs storage.Outputs) DisplayValues
func NewDisplayValuesFromParameters ¶ added in v1.0.1
func NewDisplayValuesFromParameters(bun cnab.ExtendedBundle, params map[string]interface{}) DisplayValues
func (DisplayValues) Len ¶ added in v1.0.1
func (v DisplayValues) Len() int
func (DisplayValues) Less ¶ added in v1.0.1
func (v DisplayValues) Less(i, j int) bool
func (DisplayValues) Swap ¶ added in v1.0.1
func (v DisplayValues) Swap(i, j int)
type ExplainOpts ¶
type ExplainOpts struct { BundleReferenceOptions printer.PrintOptions Action string }
func (*ExplainOpts) Validate ¶
func (o *ExplainOpts) Validate(args []string, pctx *portercontext.Context) error
type InspectableBundle ¶
type InspectableBundle struct { Name string `json:"name" yaml:"name"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Version string `json:"version" yaml:"version"` InvocationImages []PrintableInvocationImage `json:"invocationImages" yaml:"invocationImages"` Images []PrintableImage `json:"images,omitempty" yaml:"images,omitempty"` }
type InstallOptions ¶
type InstallOptions struct { *BundleExecutionOptions // Labels to apply to the installation. Labels []string }
InstallOptions that may be specified when installing a bundle. Porter handles defaulting any missing values.
func NewInstallOptions ¶ added in v0.30.0
func NewInstallOptions() InstallOptions
func (InstallOptions) GetAction ¶ added in v0.30.0
func (o InstallOptions) GetAction() string
func (InstallOptions) GetActionVerb ¶ added in v0.30.0
func (o InstallOptions) GetActionVerb() string
func (InstallOptions) ParseLabels ¶ added in v1.0.1
func (o InstallOptions) ParseLabels() map[string]string
type InternalPlugin ¶ added in v1.0.1
type InternalPlugin struct { Interface string ProtocolVersion int Create func(c *config.Config, pluginCfg interface{}) (plugin.Plugin, error) }
InternalPlugin represents the information needed to run one of the plugins defined in porter's repository.
type InvokeOptions ¶
type InvokeOptions struct { *BundleExecutionOptions // Action name to invoke Action string }
InvokeOptions that may be specified when invoking a bundle. Porter handles defaulting any missing values.
func NewInvokeOptions ¶ added in v0.30.0
func NewInvokeOptions() InvokeOptions
func (InvokeOptions) GetAction ¶ added in v0.30.0
func (o InvokeOptions) GetAction() string
func (InvokeOptions) GetActionVerb ¶ added in v0.30.0
func (o InvokeOptions) GetActionVerb() string
type LintOptions ¶
type LintOptions struct { printer.PrintOptions // File path to the porter manifest. Defaults to the bundle in the current directory. File string }
func (*LintOptions) Validate ¶
func (o *LintOptions) Validate(cxt *portercontext.Context) error
type ListOptions ¶
type ListOptions struct { printer.PrintOptions AllNamespaces bool Namespace string Name string Labels []string Skip int64 Limit int64 }
ListOptions represent generic options for use by Porter's list commands
func (ListOptions) GetNamespace ¶ added in v1.0.1
func (o ListOptions) GetNamespace() string
func (ListOptions) ParseLabels ¶ added in v1.0.1
func (o ListOptions) ParseLabels() map[string]string
func (*ListOptions) Validate ¶ added in v1.0.1
func (o *ListOptions) Validate() error
type LogsShowOptions ¶ added in v0.35.0
type LogsShowOptions struct { RunID string // contains filtered or unexported fields }
LogsShowOptions represent options for an installation logs show command
func (*LogsShowOptions) Installation ¶ added in v0.35.0
func (o *LogsShowOptions) Installation() string
Installation name passed to the command.
func (*LogsShowOptions) Validate ¶ added in v0.35.0
func (o *LogsShowOptions) Validate(cxt *portercontext.Context) error
Validate validates the provided args, using the provided context, setting attributes of LogsShowOptions as applicable
type MigrateStorageOptions ¶ added in v1.0.1
func (MigrateStorageOptions) Validate ¶ added in v1.0.1
func (o MigrateStorageOptions) Validate() error
type Mixins ¶
func (Mixins) PrintMixinsTable ¶
type MixinsCreateOptions ¶ added in v1.0.1
type MixinsCreateOptions struct { MixinName string AuthorName string AuthorUsername string DirPath string }
MixinsCreateOptions represent options for Porter's mixin create command
func (*MixinsCreateOptions) Validate ¶ added in v1.0.1
func (o *MixinsCreateOptions) Validate(args []string, cxt *portercontext.Context) error
type OutputListOptions ¶
type OutputListOptions struct { printer.PrintOptions // contains filtered or unexported fields }
OutputListOptions represent options for a bundle output list command
func (*OutputListOptions) Validate ¶
func (o *OutputListOptions) Validate(args []string, cxt *portercontext.Context) error
Validate validates the provided args, using the provided context, setting attributes of OutputListOptions as applicable
type OutputShowOptions ¶
type OutputShowOptions struct { Output string // contains filtered or unexported fields }
OutputShowOptions represent options for a bundle output show command
func (*OutputShowOptions) Validate ¶
func (o *OutputShowOptions) Validate(args []string, cxt *portercontext.Context) error
Validate validates the provided args, using the provided context, setting attributes of OutputShowOptions as applicable
type ParameterCreateOptions ¶ added in v1.0.1
ParameterCreateOptions represent options for Porter's parameter create command
func (*ParameterCreateOptions) Validate ¶ added in v1.0.1
func (o *ParameterCreateOptions) Validate(args []string) error
type ParameterDeleteOptions ¶
ParameterDeleteOptions represent options for Porter's parameter delete command
func (*ParameterDeleteOptions) Validate ¶
func (o *ParameterDeleteOptions) Validate(args []string) error
Validate the args provided to the delete parameter command
type ParameterEditOptions ¶
ParameterEditOptions represent iptions for Porter's parameter edit command
func (*ParameterEditOptions) Validate ¶
func (o *ParameterEditOptions) Validate(args []string) error
Validate validates the args provided to Porter's parameter edit command
type ParameterOptions ¶
type ParameterOptions struct { BundleReferenceOptions Silent bool Labels []string }
ParameterOptions represent generic/base options for a Porter parameters command
func (ParameterOptions) ParseLabels ¶ added in v1.0.1
func (o ParameterOptions) ParseLabels() map[string]string
type ParameterShowOptions ¶
type ParameterShowOptions struct { printer.PrintOptions Name string Namespace string }
ParameterShowOptions represent options for Porter's parameter show command
func (*ParameterShowOptions) Validate ¶
func (o *ParameterShowOptions) Validate(args []string) error
Validate validates the args provided to Porter's parameter show command
type Porter ¶
type Porter struct { *config.Config Cache cache.BundleCache Credentials storage.CredentialSetProvider Parameters storage.ParameterSetProvider Sanitizer *storage.Sanitizer Installations storage.InstallationProvider Registry cnabtooci.RegistryProvider Templates *templates.Templates Mixins mixin.MixinProvider Plugins plugins.PluginProvider CNAB cnabprovider.CNABProvider Secrets secrets.Store Storage storage.Provider // contains filtered or unexported fields }
Porter is the logic behind the porter client.
func (*Porter) Archive ¶
func (p *Porter) Archive(ctx context.Context, opts ArchiveOptions) error
Archive is a composite function that generates a CNAB thick bundle. It will pull the invocation image, and any referenced images locally (if needed), export them to individual layers, generate a bundle.json and then generate a gzipped tar archive containing the bundle.json and the images
func (*Porter) BuildActionArgs ¶ added in v0.30.0
func (p *Porter) BuildActionArgs(ctx context.Context, installation storage.Installation, action BundleAction) (cnabprovider.ActionArguments, error)
BuildActionArgs converts an instance of user-provided action options into prepared arguments that can be used to execute the action.
func (*Porter) Close ¶ added in v1.0.1
Close releases resources used by Porter before terminating the application.
func (*Porter) Connect ¶ added in v1.0.1
Connect initializes Porter for use and must be called before other Porter methods. It is the responsibility of the caller to also call Close when done with Porter.
func (*Porter) CopyBundle ¶
CopyBundle copies a bundle from one repository to another
func (*Porter) CopyTemplate ¶
func (*Porter) CreateCredential ¶ added in v1.0.1
func (p *Porter) CreateCredential(ctx context.Context, opts CredentialCreateOptions) error
func (*Porter) CreateMixin ¶ added in v1.0.1
func (p *Porter) CreateMixin(opts MixinsCreateOptions) error
func (*Porter) CreateMixinFeedTemplate ¶
func (*Porter) CreateParameter ¶ added in v1.0.1
func (p *Porter) CreateParameter(opts ParameterCreateOptions) error
func (*Porter) CredentialsApply ¶ added in v1.0.1
func (p *Porter) CredentialsApply(ctx context.Context, o ApplyOptions) error
func (*Porter) DeleteCredential ¶
func (p *Porter) DeleteCredential(ctx context.Context, opts CredentialDeleteOptions) error
DeleteCredential deletes the credential set corresponding to the provided names.
func (*Porter) DeleteInstallation ¶ added in v0.28.0
func (p *Porter) DeleteInstallation(ctx context.Context, opts DeleteOptions) error
DeleteInstallation handles deletion of an installation
func (*Porter) DeleteParameter ¶
func (p *Porter) DeleteParameter(ctx context.Context, opts ParameterDeleteOptions) error
DeleteParameter deletes the parameter set corresponding to the provided names.
func (*Porter) EditCredential ¶
func (p *Porter) EditCredential(ctx context.Context, opts CredentialEditOptions) error
EditCredential edits the credentials of the provided name.
func (*Porter) EditParameter ¶
func (p *Porter) EditParameter(ctx context.Context, opts ParameterEditOptions) error
EditParameter edits the parameters of the provided name.
func (*Porter) ExecuteAction ¶ added in v0.30.0
func (p *Porter) ExecuteAction(ctx context.Context, installation storage.Installation, action BundleAction) error
ExecuteAction runs the specified action. Supported actions are: install, upgrade, invoke. The uninstall action works in reverse so it's implemented separately.
func (*Porter) FixPermissions ¶ added in v0.38.7
func (*Porter) GenerateCredentials ¶
func (p *Porter) GenerateCredentials(ctx context.Context, opts CredentialOptions) error
GenerateCredentials builds a new credential set based on the given options. This can be either a silent build, based on the opts.Silent flag, or interactive using a survey. Returns an error if unable to generate credentials
func (*Porter) GenerateMixinFeed ¶
func (*Porter) GenerateParameters ¶
func (p *Porter) GenerateParameters(ctx context.Context, opts ParameterOptions) error
GenerateParameters builds a new parameter set based on the given options. This can be either a silent build, based on the opts.Silent flag, or interactive using a survey. Returns an error if unable to generate parameters
func (*Porter) GetBuilder ¶ added in v1.0.1
GetBuilder creates a Builder based on the current configuration.
func (*Porter) GetInstallation ¶ added in v0.35.0
func (p *Porter) GetInstallation(ctx context.Context, opts ShowOptions) (storage.Installation, *storage.Run, error)
GetInstallation retrieves information about an installation, including its most recent run.
func (*Porter) GetInstallationLogs ¶ added in v0.35.0
func (p *Porter) GetInstallationLogs(ctx context.Context, opts *LogsShowOptions) (string, bool, error)
GetInstallationLogs gets logs for an installation, according to the provided options
func (*Porter) GetManifestSchema ¶
func (*Porter) GetReplacementSchema ¶
func (*Porter) InstallBundle ¶
func (p *Porter) InstallBundle(ctx context.Context, opts InstallOptions) error
InstallBundle accepts a set of pre-validated InstallOptions and uses them to install a bundle.
func (*Porter) InstallMixin ¶
func (*Porter) InstallPlugin ¶
func (*Porter) InstallationApply ¶ added in v1.0.1
func (p *Porter) InstallationApply(ctx context.Context, opts ApplyOptions) error
func (*Porter) InvokeBundle ¶
func (p *Porter) InvokeBundle(ctx context.Context, opts InvokeOptions) error
InvokeBundle accepts a set of pre-validated InvokeOptions and uses them to upgrade a bundle.
func (*Porter) IsBundleUpToDate ¶
IsBundleUpToDate checks the hash of the manifest against the hash in cnab/bundle.json.
func (*Porter) IsInstallationInSync ¶ added in v1.0.1
func (p *Porter) IsInstallationInSync(ctx context.Context, i storage.Installation, lastRun *storage.Run, action BundleAction) (bool, error)
IsInstallationInSync determines if the desired state of the installation matches the state of the installation the last time it was modified.
func (*Porter) Lint ¶
Lint porter.yaml for any problems and report the results. This calls the mixins to analyze their sections of the manifest.
func (*Porter) ListBundleOutputs ¶
func (p *Porter) ListBundleOutputs(ctx context.Context, opts *OutputListOptions) (DisplayValues, error)
ListBundleOutputs lists the outputs for a given bundle according to the provided display format
func (*Porter) ListCredentials ¶
func (p *Porter) ListCredentials(ctx context.Context, opts ListOptions) ([]storage.CredentialSet, error)
ListCredentials lists saved credential sets.
func (*Porter) ListInstallationRuns ¶ added in v1.0.1
func (p *Porter) ListInstallationRuns(ctx context.Context, opts RunListOptions) (DisplayRuns, error)
func (*Porter) ListInstallations ¶ added in v0.28.0
func (p *Porter) ListInstallations(ctx context.Context, opts ListOptions) (DisplayInstallations, error)
ListInstallations lists installed bundles.
func (*Porter) ListMixins ¶
func (*Porter) ListParameters ¶
func (p *Porter) ListParameters(ctx context.Context, opts ListOptions) ([]storage.ParameterSet, error)
ListParameters lists saved parameter sets.
func (*Porter) ListPlugins ¶
func (*Porter) MigrateStorage ¶ added in v0.28.0
func (p *Porter) MigrateStorage(ctx context.Context, opts MigrateStorageOptions) error
func (*Porter) NewDisplayInstallationWithSecrets ¶ added in v1.0.1
func (p *Porter) NewDisplayInstallationWithSecrets(ctx context.Context, installation storage.Installation, run *storage.Run) (DisplayInstallation, error)
func (*Porter) ParametersApply ¶ added in v1.0.1
func (p *Porter) ParametersApply(ctx context.Context, o ApplyOptions) error
func (*Porter) PrintBundleOutputs ¶
func (p *Porter) PrintBundleOutputs(ctx context.Context, opts OutputListOptions) error
func (*Porter) PrintCredentials ¶ added in v1.0.1
func (p *Porter) PrintCredentials(ctx context.Context, opts ListOptions) error
PrintCredentials prints saved credential sets.
func (*Porter) PrintDebugInfo ¶
func (*Porter) PrintInstallationRuns ¶ added in v1.0.1
func (p *Porter) PrintInstallationRuns(ctx context.Context, opts RunListOptions) error
func (*Porter) PrintInstallations ¶ added in v0.28.0
func (p *Porter) PrintInstallations(ctx context.Context, opts ListOptions) error
PrintInstallations prints installed bundles.
func (*Porter) PrintLintResults ¶
func (p *Porter) PrintLintResults(ctx context.Context, opts LintOptions) error
PrintLintResults lints the manifest and prints the results to the attached output.
func (*Porter) PrintManifestSchema ¶
func (*Porter) PrintMixins ¶
func (p *Porter) PrintMixins(ctx context.Context, opts PrintMixinsOptions) error
func (*Porter) PrintPackages ¶
func (p *Porter) PrintPackages(opts SearchOptions, list pkgmgmt.PackageList) error
PrintPackages prints the provided package list according to the provided options
func (*Porter) PrintParameters ¶ added in v1.0.1
func (p *Porter) PrintParameters(ctx context.Context, opts ListOptions) error
PrintParameters prints saved parameter sets.
func (*Porter) PrintPlugins ¶
func (p *Porter) PrintPlugins(ctx context.Context, opts PrintPluginsOptions) error
func (*Porter) PrintVersion ¶
func (p *Porter) PrintVersion(ctx context.Context, opts VersionOpts) error
func (*Porter) Publish ¶
func (p *Porter) Publish(ctx context.Context, opts PublishOptions) error
Publish is a composite function that publishes an invocation image, rewrites the porter manifest and then regenerates the bundle.json. Finally it publishes the manifest to an OCI registry.
func (*Porter) PullBundle ¶
func (p *Porter) PullBundle(ctx context.Context, opts BundlePullOptions) (cache.CachedBundle, error)
PullBundle looks for a given bundle tag in the bundle cache. If it is not found, it is pulled and stored in the cache. The path to the cached bundle is returned.
func (*Porter) ReadBundleOutput ¶
func (p *Porter) ReadBundleOutput(ctx context.Context, outputName, installation, namespace string) (string, error)
ReadBundleOutput reads a bundle output from an installation
func (*Porter) ReconcileInstallation ¶ added in v1.0.1
func (p *Porter) ReconcileInstallation(ctx context.Context, opts ReconcileOptions) error
ReconcileInstallation compares the desired state of an installation as stored in the installation record with the current state of the installation. If they are not in sync, the appropriate bundle action is executed to bring them in sync. This is only used for install/upgrade actions triggered by applying a file to an installation. For uninstall or invoke, you should call those directly.
func (*Porter) RunInternalPlugins ¶
func (p *Porter) RunInternalPlugins(ctx context.Context, opts RunInternalPluginOpts) (err error)
func (*Porter) SearchPackages ¶
func (p *Porter) SearchPackages(opts SearchOptions) error
SearchPackages searches the provided package list according to the provided options
func (*Porter) ShowBundleOutput ¶
func (p *Porter) ShowBundleOutput(ctx context.Context, opts *OutputShowOptions) error
ShowBundleOutput shows a bundle output value, according to the provided options
func (*Porter) ShowCredential ¶
func (p *Porter) ShowCredential(ctx context.Context, opts CredentialShowOptions) error
ShowCredential shows the credential set corresponding to the provided name, using the provided printer.PrintOptions for display.
func (*Porter) ShowInstallation ¶ added in v0.28.0
func (p *Porter) ShowInstallation(ctx context.Context, opts ShowOptions) error
ShowInstallation shows a bundle installation, along with any associated outputs
func (*Porter) ShowInstallationLogs ¶ added in v0.35.0
func (p *Porter) ShowInstallationLogs(ctx context.Context, opts *LogsShowOptions) error
ShowInstallationLogs shows logs for an installation, according to the provided options.
func (*Porter) ShowParameter ¶
func (p *Porter) ShowParameter(ctx context.Context, opts ParameterShowOptions) error
ShowParameter shows the parameter set corresponding to the provided name, using the provided printer.PrintOptions for display.
func (*Porter) ShowPlugin ¶
func (p *Porter) ShowPlugin(ctx context.Context, opts ShowPluginOptions) error
func (*Porter) UninstallBundle ¶
func (p *Porter) UninstallBundle(ctx context.Context, opts UninstallOptions) error
UninstallBundle accepts a set of pre-validated UninstallOptions and uses them to uninstall a bundle.
func (*Porter) UninstallMixin ¶
func (*Porter) UninstallPlugin ¶
func (*Porter) UpgradeBundle ¶
func (p *Porter) UpgradeBundle(ctx context.Context, opts *UpgradeOptions) error
UpgradeBundle accepts a set of pre-validated UpgradeOptions and uses them to upgrade a bundle.
type PrintMixinsOptions ¶
type PrintMixinsOptions struct {
printer.PrintOptions
}
PrintMixinsOptions represent options for the PrintMixins function
type PrintPluginsOptions ¶
type PrintPluginsOptions struct {
printer.PrintOptions
}
PrintPluginsOptions represent options for the PrintPlugins function
type PrintableAction ¶
type PrintableAction struct { Name string `json:"name" yaml:"name"` Modifies bool `json:"modifies" yaml:"modifies"` // Stateless indicates that the action is purely informational, that credentials are not required, and that the runtime should not keep track of its invocation Stateless bool `json:"stateless" yaml:"stateless"` // Description describes the action as a user-readable string Description string `json:"description" yaml:"description"` }
type PrintableBundle ¶
type PrintableBundle struct { Name string `json:"name" yaml:"name"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Version string `json:"version" yaml:"version"` PorterVersion string `json:"porterVersion,omitempty" yaml:"porterVersion,omitempty"` Parameters []PrintableParameter `json:"parameters,omitempty" yaml:"parameters,omitempty"` Credentials []PrintableCredential `json:"credentials,omitempty" yaml:"credentials,omitempty"` Outputs []PrintableOutput `json:"outputs,omitempty" yaml:"outputs,omitempty"` Actions []PrintableAction `json:"customActions,omitempty" yaml:"customActions,omitempty"` Dependencies []PrintableDependency `json:"dependencies,omitempty" yaml:"dependencies,omitempty"` Mixins []string `json:"mixins" yaml:"mixins"` }
PrintableBundle holds a subset of pertinent values to be explained from a bundle
type PrintableCredential ¶
type PrintableDependency ¶ added in v0.29.0
type PrintableImage ¶
type PrintableInvocationImage ¶
type PrintableInvocationImage struct { bundle.InvocationImage Original string `json:"originalImage" yaml:"originalImage"` }
type PrintableOutput ¶
type PrintableParameter ¶
type PrintableParameter struct { Name string `json:"name" yaml:"name"` Type interface{} `json:"type" yaml:"type"` Default interface{} `json:"default" yaml:"default"` ApplyTo string `json:"applyTo" yaml:"applyTo"` Description string `json:"description" yaml:"description"` Required bool `json:"required" yaml:"required"` Sensitive bool `json:"sensitive" yaml:"sensitive"` // contains filtered or unexported fields }
type PublishOptions ¶
type PublishOptions struct { BundlePullOptions Tag string Registry string ArchiveFile string // contains filtered or unexported fields }
PublishOptions are options that may be specified when publishing a bundle. Porter handles defaulting any missing values.
type ReconcileOptions ¶ added in v1.0.1
type RunInternalPluginOpts ¶
type RunInternalPluginOpts struct {
Key string
}
func (*RunInternalPluginOpts) ApplyArgs ¶ added in v1.0.1
func (o *RunInternalPluginOpts) ApplyArgs(args []string) error
func (*RunInternalPluginOpts) Validate ¶
func (o *RunInternalPluginOpts) Validate() error
type RunListOptions ¶ added in v1.0.1
type RunListOptions struct { printer.PrintOptions // contains filtered or unexported fields }
RunListOptions represent options for showing runs of an installation
func (*RunListOptions) Validate ¶ added in v1.0.1
func (so *RunListOptions) Validate(args []string, cxt *portercontext.Context) error
Validate prepares for the list installation runs action and validates the args/options.
type RunOptions ¶
type RunOptions struct { // Debug specifies if the bundle should be run in debug mode DebugMode bool // File is the path to the porter manifest. File string // Action name to run in the bundle, such as install. Action string // contains filtered or unexported fields }
func NewRunOptions ¶
func NewRunOptions(c *config.Config) RunOptions
func (*RunOptions) Validate ¶
func (o *RunOptions) Validate() error
type SearchOptions ¶
type SearchOptions struct { Name string Type string printer.PrintOptions pkgmgmt.PackageDownloadOptions }
SearchOptions are options for searching packages
func (*SearchOptions) Validate ¶
func (o *SearchOptions) Validate(args []string) error
Validate validates the arguments provided to a search command
type ShowOptions ¶
type ShowOptions struct { printer.PrintOptions // contains filtered or unexported fields }
ShowOptions represent options for showing a particular installation
func (*ShowOptions) Validate ¶
func (so *ShowOptions) Validate(args []string, cxt *portercontext.Context) error
Validate prepares for a show bundle action and validates the args/options.
type ShowPluginOptions ¶
type ShowPluginOptions struct { printer.PrintOptions Name string }
ShowPluginOptions represent options for showing a particular plugin.
func (*ShowPluginOptions) Validate ¶
func (o *ShowPluginOptions) Validate(args []string) error
type SortPrintableAction ¶
type SortPrintableAction []PrintableAction
func (SortPrintableAction) Len ¶
func (s SortPrintableAction) Len() int
func (SortPrintableAction) Less ¶
func (s SortPrintableAction) Less(i, j int) bool
func (SortPrintableAction) Swap ¶
func (s SortPrintableAction) Swap(i, j int)
type SortPrintableCredential ¶
type SortPrintableCredential []PrintableCredential
func (SortPrintableCredential) Len ¶
func (s SortPrintableCredential) Len() int
func (SortPrintableCredential) Less ¶
func (s SortPrintableCredential) Less(i, j int) bool
func (SortPrintableCredential) Swap ¶
func (s SortPrintableCredential) Swap(i, j int)
type SortPrintableOutput ¶
type SortPrintableOutput []PrintableOutput
func (SortPrintableOutput) Len ¶
func (s SortPrintableOutput) Len() int
func (SortPrintableOutput) Less ¶
func (s SortPrintableOutput) Less(i, j int) bool
func (SortPrintableOutput) Swap ¶
func (s SortPrintableOutput) Swap(i, j int)
type SortPrintableParameter ¶
type SortPrintableParameter []PrintableParameter
func (SortPrintableParameter) Len ¶
func (s SortPrintableParameter) Len() int
func (SortPrintableParameter) Less ¶
func (s SortPrintableParameter) Less(i, j int) bool
func (SortPrintableParameter) Swap ¶
func (s SortPrintableParameter) Swap(i, j int)
type SystemDebugInfo ¶
type SystemDebugInfo struct { Version pkgmgmt.PackageMetadata `json:"version"` SysInfo SystemInfo `json:"system"` Mixins Mixins `json:"mixins"` }
type SystemInfo ¶
type TestBuildProvider ¶
type TestBuildProvider struct { }
func NewTestBuildProvider ¶
func NewTestBuildProvider() *TestBuildProvider
func (*TestBuildProvider) BuildInvocationImage ¶
func (t *TestBuildProvider) BuildInvocationImage(ctx context.Context, manifest *manifest.Manifest, opts build.BuildImageOptions) error
func (*TestBuildProvider) TagInvocationImage ¶ added in v0.31.0
func (t *TestBuildProvider) TagInvocationImage(ctx context.Context, origTag, newTag string) error
type TestDriver ¶ added in v0.28.0
type TestPorter ¶
type TestPorter struct { *Porter TestConfig *config.TestConfig TestStore storage.TestStore TestInstallations *storage.TestInstallationProvider TestCredentials *storage.TestCredentialSetProvider TestParameters *storage.TestParameterSetProvider TestCache *cache.TestCache TestRegistry *cnabtooci.TestRegistry TestSecrets secrets.Store TestSanitizer *storage.Sanitizer // original directory where the test was being executed TestDir string // directory where the integration test is being executed BundleDir string // root of the repository // Helps us avoid hard coding relative paths from test directories, which easily break when tests are moved RepoRoot string // The root test context created by NewTestPorter RootContext context.Context // The root log span created by NewTestPorter RootSpan tracing.TraceLogger }
func NewTestPorter ¶
func NewTestPorter(t *testing.T) *TestPorter
NewTestPorter initializes a porter test client, with the output buffered, and an in-memory file system.
func (*TestPorter) AddTestBundleDir ¶ added in v0.31.0
func (p *TestPorter) AddTestBundleDir(bundleDir string, generateUniqueName bool) string
AddTestBundleDir into the test bundle directory and give it a unique name to avoid collisions with other tests running in parallel.
func (*TestPorter) AddTestDriver ¶ added in v0.28.0
func (p *TestPorter) AddTestDriver(driver TestDriver) string
func (*TestPorter) AddTestFile ¶ added in v0.28.0
func (p *TestPorter) AddTestFile(src string, dest string)
func (*TestPorter) Close ¶ added in v1.0.1
func (p *TestPorter) Close() error
func (*TestPorter) CompareGoldenFile ¶ added in v1.0.1
func (p *TestPorter) CompareGoldenFile(goldenFile string, got string)
CompareGoldenFile checks if the specified string matches the content of a golden test file. When they are different and PORTER_UPDATE_TEST_FILES is true, the file is updated to match the new test output.
func (*TestPorter) CreateBundleDir ¶
func (p *TestPorter) CreateBundleDir() string
func (*TestPorter) CreateOutput ¶ added in v1.0.1
func (p *TestPorter) CreateOutput(o storage.Output, bun cnab.ExtendedBundle) storage.Output
func (*TestPorter) RandomString ¶ added in v0.31.0
func (p *TestPorter) RandomString(len int) string
func (*TestPorter) ReadBundle ¶ added in v0.28.0
func (p *TestPorter) ReadBundle(path string) cnab.ExtendedBundle
func (*TestPorter) SanitizeParameters ¶ added in v1.0.1
func (p *TestPorter) SanitizeParameters(raw []secrets.Strategy, recordID string, bun cnab.ExtendedBundle) []secrets.Strategy
CreateInstallation saves an installation record into claim store and store sensitive parameters into secret store.
func (*TestPorter) SetupIntegrationTest ¶
func (p *TestPorter) SetupIntegrationTest() context.Context
func (*TestPorter) T ¶
func (p *TestPorter) T() *testing.T
type UninstallDeleteOptions ¶ added in v0.28.0
UninstallDeleteOptions supply options for deletion on uninstall
type UninstallOptions ¶
type UninstallOptions struct { *BundleExecutionOptions UninstallDeleteOptions }
UninstallOptions that may be specified when uninstalling a bundle. Porter handles defaulting any missing values.
func NewUninstallOptions ¶ added in v0.30.0
func NewUninstallOptions() UninstallOptions
func (UninstallOptions) GetAction ¶ added in v0.30.0
func (o UninstallOptions) GetAction() string
func (UninstallOptions) GetActionVerb ¶ added in v0.30.0
func (o UninstallOptions) GetActionVerb() string
type UpgradeOptions ¶
type UpgradeOptions struct { *BundleExecutionOptions // Version of the bundle to upgrade to Version string }
UpgradeOptions that may be specified when upgrading a bundle. Porter handles defaulting any missing values.
func NewUpgradeOptions ¶ added in v0.30.0
func NewUpgradeOptions() *UpgradeOptions
func (*UpgradeOptions) GetAction ¶ added in v0.30.0
func (o *UpgradeOptions) GetAction() string
func (*UpgradeOptions) GetActionVerb ¶ added in v0.30.0
func (o *UpgradeOptions) GetActionVerb() string
type VersionOpts ¶
Source Files ¶
- action.go
- apply.go
- archive.go
- build.go
- cnab.go
- copy.go
- create.go
- credentials.go
- delete.go
- dependencies.go
- doc.go
- explain.go
- generateManifest.go
- helpers.go
- inspect.go
- install.go
- internal_plugins.go
- invoke.go
- lifecycle.go
- lint.go
- list.go
- logs.go
- mixins.go
- options.go
- outputs.go
- packages.go
- parameters.go
- plugins.go
- porter.go
- publish.go
- pull.go
- reconcile.go
- resolver.go
- run.go
- runs.go
- schema.go
- show.go
- stamp.go
- storage.go
- uninstall.go
- upgrade.go
- version.go