jobspec

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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"`

	// Signifies whether the jobspec should be parsed as HCL1 or not
	Hcl1 bool `hcl:"hcl1,optional"`
}

Config is the configuration structure for the Platform.

type Deployment added in v0.8.0

type Deployment struct {
	Id            string         `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name          string         `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	ResourceState *opaqueany.Any `protobuf:"bytes,3,opt,name=resource_state,json=resourceState,proto3" json:"resource_state,omitempty"`
	// contains filtered or unexported fields
}

func (*Deployment) Descriptor deprecated added in v0.8.0

func (*Deployment) Descriptor() ([]byte, []int)

Deprecated: Use Deployment.ProtoReflect.Descriptor instead.

func (*Deployment) GetId added in v0.8.0

func (x *Deployment) GetId() string

func (*Deployment) GetName added in v0.8.0

func (x *Deployment) GetName() string

func (*Deployment) GetResourceState added in v0.8.0

func (x *Deployment) GetResourceState() *opaqueany.Any

func (*Deployment) ProtoMessage added in v0.8.0

func (*Deployment) ProtoMessage()

func (*Deployment) ProtoReflect added in v0.8.0

func (x *Deployment) ProtoReflect() protoreflect.Message

func (*Deployment) Reset added in v0.8.0

func (x *Deployment) Reset()

func (*Deployment) String added in v0.8.0

func (x *Deployment) String() string

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,
	dcr *component.DeclaredResourcesResp,
	ui terminal.UI,
) (*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 *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

func (*Platform) Status added in v0.8.0

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

func (*Platform) StatusFunc added in v0.8.0

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

StatusFunc implements component.Status

type Release added in v0.8.0

type Release struct {
	Url           string         `protobuf:"bytes,1,opt,name=Url,proto3" json:"Url,omitempty"`
	ResourceState *opaqueany.Any `protobuf:"bytes,2,opt,name=resource_state,json=resourceState,proto3" json:"resource_state,omitempty"`
	// contains filtered or unexported fields
}

func (*Release) Descriptor deprecated added in v0.8.0

func (*Release) Descriptor() ([]byte, []int)

Deprecated: Use Release.ProtoReflect.Descriptor instead.

func (*Release) GetResourceState added in v0.8.0

func (x *Release) GetResourceState() *opaqueany.Any

func (*Release) GetUrl added in v0.8.0

func (x *Release) GetUrl() string

func (*Release) ProtoMessage added in v0.8.0

func (*Release) ProtoMessage()

func (*Release) ProtoReflect added in v0.8.0

func (x *Release) ProtoReflect() protoreflect.Message

func (*Release) Reset added in v0.8.0

func (x *Release) Reset()

func (*Release) String added in v0.8.0

func (x *Release) String() string

func (*Release) URL added in v0.8.0

func (r *Release) URL() string

type Releaser added in v0.8.0

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

Releaser is the ReleaseManager implementation for Nomad.

func (*Releaser) Config added in v0.8.0

func (r *Releaser) Config() (interface{}, error)

Config implements Configurable

func (*Releaser) Destroy added in v0.8.0

func (r *Releaser) Destroy(
	ctx context.Context,
	log hclog.Logger,
	release *Release,
	ui terminal.UI,
) error

func (*Releaser) DestroyFunc added in v0.8.0

func (r *Releaser) DestroyFunc() interface{}

DestroyFunc implements component.Destroyer

func (*Releaser) Documentation added in v0.8.0

func (r *Releaser) Documentation() (*docs.Documentation, error)

func (*Releaser) Release added in v0.8.0

func (r *Releaser) Release(
	ctx context.Context,
	log hclog.Logger,
	src *component.Source,
	job *component.JobInfo,
	ui terminal.UI,
	target *Deployment,
	dcr *component.DeclaredResourcesResp,
) (*Release, error)

Release promotes the Nomad canary deployment

func (*Releaser) ReleaseFunc added in v0.8.0

func (r *Releaser) ReleaseFunc() interface{}

ReleaseFunc implements component.ReleaseManager

func (*Releaser) Status added in v0.8.0

func (r *Releaser) Status(
	ctx context.Context,
	log hclog.Logger,
	release *Release,
	ui terminal.UI,
) (*sdk.StatusReport, error)

func (*Releaser) StatusFunc added in v0.8.0

func (r *Releaser) StatusFunc() interface{}

StatusFunc implements component.Status

type ReleaserConfig added in v0.8.0

type ReleaserConfig struct {
	// List of task group names which are to be promoted
	Groups []string `hcl:"groups,optional"`

	// If true, marks the deployment as failed
	FailDeployment bool `hcl:"fail_deployment,optional"`
}

ReleaserConfig is the configuration structure for the Releaser.

type Resource added in v0.8.0

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

Resource contains the internal resource states.

func (*Resource) Descriptor deprecated added in v0.8.0

func (*Resource) Descriptor() ([]byte, []int)

Deprecated: Use Resource.ProtoReflect.Descriptor instead.

func (*Resource) ProtoMessage added in v0.8.0

func (*Resource) ProtoMessage()

func (*Resource) ProtoReflect added in v0.8.0

func (x *Resource) ProtoReflect() protoreflect.Message

func (*Resource) Reset added in v0.8.0

func (x *Resource) Reset()

func (*Resource) String added in v0.8.0

func (x *Resource) String() string

type Resource_Job added in v0.8.0

type Resource_Job struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Resource_Job) Descriptor deprecated added in v0.8.0

func (*Resource_Job) Descriptor() ([]byte, []int)

Deprecated: Use Resource_Job.ProtoReflect.Descriptor instead.

func (*Resource_Job) GetName added in v0.8.0

func (x *Resource_Job) GetName() string

func (*Resource_Job) ProtoMessage added in v0.8.0

func (*Resource_Job) ProtoMessage()

func (*Resource_Job) ProtoReflect added in v0.8.0

func (x *Resource_Job) ProtoReflect() protoreflect.Message

func (*Resource_Job) Reset added in v0.8.0

func (x *Resource_Job) Reset()

func (*Resource_Job) String added in v0.8.0

func (x *Resource_Job) String() string

Jump to

Keyboard shortcuts

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