Documentation
¶
Index ¶
- Constants
- func ExtractJobRegionNamespace(hclText string) (region, namespace string, err error)
- func NewDeployer(client *api.Client, cfg *CLIConfig) runner.Runner
- type CLIConfig
- type ErrExistsInDeployment
- type ErrExistsNonPack
- type ParsedTemplate
- type PlanCLIConfig
- type RunCLIConfig
- type Runner
- func (r *Runner) CanonicalizeTemplates() []*errors.WrappedUIContext
- func (r *Runner) CheckForConflicts(errCtx *errors.UIErrorContext) []*errors.WrappedUIContext
- func (r *Runner) Deploy(ui terminal.UI, errorContext *errors.UIErrorContext) *errors.WrappedUIContext
- func (r *Runner) DestroyDeployment(ui terminal.UI) []*errors.WrappedUIContext
- func (r *Runner) EvalIDs() []string
- func (r *Runner) Name() string
- func (r *Runner) ParseTemplates() []*errors.WrappedUIContext
- func (r *Runner) ParsedTemplates() any
- func (r *Runner) PlanDeployment(ui terminal.UI, errCtx *errors.UIErrorContext) (int, []*errors.WrappedUIContext)
- func (r *Runner) SetRunnerConfig(cfg *runner.Config)
- func (r *Runner) SetTemplates(templates map[string]string)
Constants ¶
const ( PackPathKey = "pack.path" PackNameKey = "pack.name" PackRegistryKey = "pack.registry" PackDeploymentNameKey = "pack.deployment_name" PackJobKey = "pack.job" PackRefKey = "pack.version" )
Variables ¶
This section is empty.
Functions ¶
func ExtractJobRegionNamespace ¶ added in v0.4.2
ExtractJobRegionNamespace parses the rendered HCL job spec and returns the region and namespace values from the top-level job block only. This avoids falsely treating any pack variable named "region" or "namespace" as Nomad client settings.
func NewDeployer ¶
NewDeployer returns the job implementation of deploy.Deployer. This is responsible for handling packs that contain job specifications.
TODO(jrasell): design a nice method to have the QueryOpts setup once and available to all subsystems that use a Nomad client.
Types ¶
type CLIConfig ¶
type CLIConfig struct {
RunConfig *RunCLIConfig
PlanConfig *PlanCLIConfig
}
CLIConfig contains all possible configurations required by the Nomad Pack CLI in order to render, plan, run, and destroy job templates.
type ErrExistsInDeployment ¶
func (ErrExistsInDeployment) Error ¶
func (e ErrExistsInDeployment) Error() string
type ErrExistsNonPack ¶
type ErrExistsNonPack struct {
JobID string
}
func (ErrExistsNonPack) Error ¶
func (e ErrExistsNonPack) Error() string
type ParsedTemplate ¶
type ParsedTemplate struct {
// contains filtered or unexported fields
}
func (*ParsedTemplate) GetName ¶
func (p *ParsedTemplate) GetName() string
func (*ParsedTemplate) HasNamespace ¶
func (p *ParsedTemplate) HasNamespace() bool
func (*ParsedTemplate) HasRegion ¶
func (p *ParsedTemplate) HasRegion() bool
func (*ParsedTemplate) Job ¶
func (p *ParsedTemplate) Job() *api.Job
type PlanCLIConfig ¶
PlanCLIConfig specifies the configuration that is used by the Nomad Pack plan command.
type RunCLIConfig ¶
type RunCLIConfig struct {
CheckIndex uint64
ConsulToken string
ConsulNamespace string
VaultToken string
VaultNamespace string
EnableRollback bool
PreserveCounts bool
PreserveResources bool
DeployOverride bool
PolicyOverride bool
Detach bool
Verbose bool
}
RunCLIConfig specifies the configuration that is used by the Nomad Pack run command.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner is the job implementation of the runner.Runner interface.
func (*Runner) CanonicalizeTemplates ¶
func (r *Runner) CanonicalizeTemplates() []*errors.WrappedUIContext
CanonicalizeTemplates satisfies the CanonicalizeTemplates function of the runner.Runner interface.
func (*Runner) CheckForConflicts ¶
func (r *Runner) CheckForConflicts(errCtx *errors.UIErrorContext) []*errors.WrappedUIContext
func (*Runner) Deploy ¶
func (r *Runner) Deploy(ui terminal.UI, errorContext *errors.UIErrorContext) *errors.WrappedUIContext
Deploy satisfies the Deploy function of the runner.Runner interface.
func (*Runner) DestroyDeployment ¶
func (r *Runner) DestroyDeployment(ui terminal.UI) []*errors.WrappedUIContext
func (*Runner) EvalIDs ¶ added in v0.4.2
EvalIDs returns the evaluation IDs from the most recent Deploy call.
func (*Runner) ParseTemplates ¶
func (r *Runner) ParseTemplates() []*errors.WrappedUIContext
ParseTemplates satisfies the ParseTemplates function of the deploy.Deployer interface.
func (*Runner) ParsedTemplates ¶
ParsedTemplates satisfies the GetParsedTemplates function of the runner.Runner interface.
func (*Runner) PlanDeployment ¶
func (r *Runner) PlanDeployment(ui terminal.UI, errCtx *errors.UIErrorContext) (int, []*errors.WrappedUIContext)
PlanDeployment satisfies the PlanDeployment function of the runner.Runner interface.
func (*Runner) SetRunnerConfig ¶
SetRunnerConfig satisfies the SetRunnerConfig function of the runner.Runner interface.
func (*Runner) SetTemplates ¶
SetTemplates satisfies the SetTemplates function of the runner.Runner interface.