Run postgres on the SDK's harness and moved path, dropping its copies (issue 849)
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.novox.be/novox/mesh-sdk/go/provider/harness"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -32,12 +33,12 @@ func main() {
|
||||
}
|
||||
return
|
||||
}
|
||||
var h *Harness
|
||||
var h *harness.Harness
|
||||
if consumers := handedConsumersFile(os.Getenv, os.Stat); consumers != "" {
|
||||
// Handed to the provisioner (novox/hq ADR 0373): the provider helper answers the consumers its
|
||||
// machine's client fills the file with, and the grant file still gives the consumers not moved
|
||||
// (issue 937). Retirement is the harness's, never run, so its guards and its tools stand (issue 780).
|
||||
h = &Harness{
|
||||
h = &harness.Harness{
|
||||
Resource: ProvisionName,
|
||||
Receives: os.Getenv("MESH_RECEIVES"),
|
||||
Adapter: provisioner{pg: pg, announce: announce},
|
||||
@@ -62,7 +63,7 @@ func main() {
|
||||
} else if receives := os.Getenv("MESH_RECEIVES"); receives == "" {
|
||||
say("MESH_RECEIVES is not set — the provisioner cannot run without it")
|
||||
} else {
|
||||
h = &Harness{
|
||||
h = &harness.Harness{
|
||||
Resource: "postgres-database",
|
||||
Receives: receives,
|
||||
Adapter: provisioner{pg: pg, announce: announce},
|
||||
@@ -93,7 +94,7 @@ func main() {
|
||||
go pg.RunReader(context.Background(), os.Getenv("MESH_RECEIVES"), time.Minute, say)
|
||||
// The retirement tools beside postgres's own: what is retired here, approving or rejecting what waits
|
||||
// for a person, and deleting a retired consumer (novox/hq ADR 0230).
|
||||
if err := stdio.Serve("", append(Tools(pg), RetirementTools(h)...)); err != nil {
|
||||
if err := stdio.Serve("", append(Tools(pg), harness.RetirementTools(h)...)); err != nil {
|
||||
say("%v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user