package volumes3

import "github.com/hashicorp/nomad/e2e/v3/volumes3"

Index

Functions

func Create

func Create(t *testing.T, filename string, opts ...Option) (*VolumeSubmission, Cleanup)

Types

type Cleanup

type Cleanup func()

type Option

type Option func(*VolumeSubmission)

func WithClient

func WithClient(client *nomadapi.Client) Option

WithClient forces the submission to use the Nomad API client passed from the calling test

func WithNamespace

func WithNamespace(ns string) Option

WithNamespace sets a specific namespace for the volume and the wait query. The namespace should not be set in the spec if you're using this option.

func WithNoCleanup

func WithNoCleanup() Option

WithNoCleanup is used for test debugging to skip tearing down the volume

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout changes the default timeout from 10s

func WithVerbose

func WithVerbose() Option

WithVerbose is used for test debugging to write more logs

func WithWaitState

func WithWaitState(state api.HostVolumeState) Option

WithWaitState changes the default state we wait for after creating the volume from the default of "ready"

type VolumeSubmission

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

VolumeSubmission holds state around creating and cleaning up a dynamic host volume.

func (*VolumeSubmission) Get

func (sub *VolumeSubmission) Get() *nomadapi.HostVolume

Get fetches the api.HostVolume from the server for further examination

func (*VolumeSubmission) NodeID

func (sub *VolumeSubmission) NodeID() string

NodeID returns the node ID, which may have been set by the server

func (*VolumeSubmission) VolumeID

func (sub *VolumeSubmission) VolumeID() string

VolumeID returns the volume ID set by the server

Source Files

host3.go

Version
v1.10.0 (latest)
Published
Apr 9, 2025
Platform
linux/amd64
Imports
11 packages
Last checked
39 seconds ago

Tools for package owners.