2018-06-29 00:01:05 +00:00
|
|
|
package allocrunnerv2
|
2018-06-22 00:35:07 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/boltdb/bolt"
|
|
|
|
log "github.com/hashicorp/go-hclog"
|
|
|
|
clientconfig "github.com/hashicorp/nomad/client/config"
|
2018-07-19 00:06:44 +00:00
|
|
|
"github.com/hashicorp/nomad/client/interfaces"
|
2018-07-12 23:15:33 +00:00
|
|
|
"github.com/hashicorp/nomad/client/vaultclient"
|
2018-06-22 00:35:07 +00:00
|
|
|
"github.com/hashicorp/nomad/nomad/structs"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Config holds the configuration for creating an allocation runner.
|
|
|
|
type Config struct {
|
|
|
|
// Logger is the logger for the allocation runner.
|
|
|
|
Logger log.Logger
|
|
|
|
|
|
|
|
// ClientConfig is the clients configuration.
|
|
|
|
ClientConfig *clientconfig.Config
|
|
|
|
|
2018-06-29 00:01:05 +00:00
|
|
|
// Alloc captures the allocation that should be run.
|
|
|
|
Alloc *structs.Allocation
|
2018-06-22 00:35:07 +00:00
|
|
|
|
|
|
|
// StateDB is used to store and restore state.
|
|
|
|
StateDB *bolt.DB
|
|
|
|
|
2018-07-12 23:15:33 +00:00
|
|
|
// Vault is the Vault client to use to retrieve Vault tokens
|
|
|
|
Vault vaultclient.VaultClient
|
|
|
|
|
2018-07-19 00:06:44 +00:00
|
|
|
// StateUpdater is used to emit updated task state
|
|
|
|
StateUpdater interfaces.AllocStateHandler
|
2018-06-22 00:35:07 +00:00
|
|
|
}
|