volume

package
v0.0.0-...-02c76fb Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Preparer

type Preparer struct {
	// name of the volume
	Name string `hcl:"name" required:"true" nonempty:"true"`

	// volume driver. default: local
	Driver string `hcl:"driver" default:"local"`

	// labels to set on the volume
	Labels map[string]string `hcl:"labels"`

	// driver specific options
	Options map[string]string `hcl:"options"`

	// indicates whether the volume should exist.
	State State `hcl:"state" valid_values:"present,absent"`

	// indicates whether or not the volume will be recreated if the state is not
	// what is expected. By default, the module will only check to see if the
	// volume exists. Specified as a boolean value
	Force bool `hcl:"force"`
}

Preparer for docker volumes

Volume is responsible for managing Docker volumes. It assumes that there is already a Docker daemon running on the system. *Note: docker resources are not currently supported on Solaris.*

func (*Preparer) Prepare

func (p *Preparer) Prepare(ctx context.Context, render resource.Renderer) (resource.Task, error)

Prepare a docker volume

type State

type State string

State type for Volume

const (
	// StatePresent indicates the volume should be present
	StatePresent State = "present"

	// StateAbsent indicates the volume should be absent
	StateAbsent State = "absent"
)

type Volume

type Volume struct {

	// volume name
	Name string `export:"name"`

	// volume labels
	Labels map[string]string `export:"labels"`

	// driver the volume is configured to use
	Driver string `export:"driver"`

	// driver-specific options
	Options map[string]string `export:"options"`

	// volume state
	State State `export:"state"`

	// reflects whether or not the force option was configured
	Force bool `export:"force"`
	// contains filtered or unexported fields
}

Volume is responsible for managing docker volumes

func (*Volume) Apply

Apply ensures the volume matches the desired state

func (*Volume) Check

Check system for docker volume

func (*Volume) SetClient

func (v *Volume) SetClient(client docker.VolumeClient)

SetClient injects a docker api client

Jump to

Keyboard shortcuts

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