jobspec

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MPL-2.0 Imports: 24 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{}),
}

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 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"`
	Id        string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,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) GetId added in v0.10.0

func (x *Resource_Job) GetId() string

func (*Resource_Job) GetName added in v0.8.0

func (x *Resource_Job) GetName() string

func (*Resource_Job) GetNamespace added in v0.10.0

func (x *Resource_Job) GetNamespace() 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