canary

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 23 Imported by: 0

README

Nomad Jobspec Canary

The Nomad Jobspec Canary plugin promotes a Nomad canary deployment initiated by a Nomad jobspec deployment.

Components

  1. ReleaseManager
  1. Nomad Jobspec

Resources

  1. Nomad Job

Documentation

Index

Constants

This section is empty.

Variables

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

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

Functions

This section is empty.

Types

type Release

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

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

Deprecated: Use Release.ProtoReflect.Descriptor instead.

func (*Release) GetResourceState

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

func (*Release) GetUrl

func (x *Release) GetUrl() string

func (*Release) ProtoMessage

func (*Release) ProtoMessage()

func (*Release) ProtoReflect

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

func (*Release) Reset

func (x *Release) Reset()

func (*Release) String

func (x *Release) String() string

func (*Release) URL

func (r *Release) URL() string

type Releaser

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

Releaser is the ReleaseManager implementation for Nomad.

func (*Releaser) Config

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

Config implements Configurable

func (*Releaser) Destroy

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

func (*Releaser) DestroyFunc

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

DestroyFunc implements component.Destroyer

func (*Releaser) Documentation

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

func (*Releaser) Release

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

Release promotes the Nomad canary deployment

func (*Releaser) ReleaseFunc

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

ReleaseFunc implements component.ReleaseManager

func (*Releaser) Status

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

func (*Releaser) StatusFunc

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

StatusFunc implements component.Status

type ReleaserConfig

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.

Jump to

Keyboard shortcuts

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