job

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
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

func ExtractJobRegionNamespace(hclText string) (region, namespace string, err error)

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

func NewDeployer(client *api.Client, cfg *CLIConfig) runner.Runner

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

type ErrExistsInDeployment struct {
	JobID      string
	Deployment string
}

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

type PlanCLIConfig struct {
	DeployOverride bool
	PolicyOverride bool
	Verbose        bool
	Diff           bool
}

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

func (r *Runner) EvalIDs() []string

EvalIDs returns the evaluation IDs from the most recent Deploy call.

func (*Runner) Name

func (r *Runner) Name() string

Name satisfies the Name function of the runner.Runner interface.

func (*Runner) ParseTemplates

func (r *Runner) ParseTemplates() []*errors.WrappedUIContext

ParseTemplates satisfies the ParseTemplates function of the deploy.Deployer interface.

func (*Runner) ParsedTemplates

func (r *Runner) ParsedTemplates() any

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

func (r *Runner) SetRunnerConfig(cfg *runner.Config)

SetRunnerConfig satisfies the SetRunnerConfig function of the runner.Runner interface.

func (*Runner) SetTemplates

func (r *Runner) SetTemplates(templates map[string]string)

SetTemplates satisfies the SetTemplates function of the runner.Runner interface.

Jump to

Keyboard shortcuts

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