jobspec

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Options = []sdk.Option{
	sdk.WithComponents(&Platform{}),
}

Options are the SDK options to use for instantiation for the Nomad plugin.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The path to the job specification to load.
	Jobspec string `hcl:"jobspec,attr"`
}

Config is the configuration structure for the Platform.

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

Platform is the Platform implementation for Nomad.

func (*Platform) Config

func (p *Platform) Config() (interface{}, error)

Config implements Configurable

func (*Platform) Deploy

func (p *Platform) Deploy(
	ctx context.Context,
	log hclog.Logger,
	src *component.Source,
	img *docker.Image,
	deployConfig *component.DeploymentConfig,
	ui terminal.UI,
) (*nomad.Deployment, error)

Deploy deploys an image to Nomad.

func (*Platform) DeployFunc

func (p *Platform) DeployFunc() interface{}

DeployFunc implements component.Platform

func (*Platform) Destroy

func (p *Platform) Destroy(
	ctx context.Context,
	log hclog.Logger,
	deployment *nomad.Deployment,
	ui terminal.UI,
) error

Destroy deletes the Nomad job.

func (*Platform) DestroyFunc

func (p *Platform) DestroyFunc() interface{}

DestroyFunc implements component.Destroyer

func (*Platform) Documentation

func (p *Platform) Documentation() (*docs.Documentation, error)

func (*Platform) Generation

func (p *Platform) Generation(
	ctx context.Context,
	log hclog.Logger,
	src *component.Source,
	img *docker.Image,
	deployConfig *component.DeploymentConfig,
	ui terminal.UI,
) ([]byte, error)

Generation returns the generation ID. The ID we use is the name of the job since this is the unique ID that determines insert vs. update behavior for Nomad.

func (*Platform) GenerationFunc

func (p *Platform) GenerationFunc() interface{}

GenerationFunc implements component.Generation

Jump to

Keyboard shortcuts

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