A provider failed every consumer for a day and said so only in its journal (hq issue 179). The provisioner loop now emits provisioner.failing after five minutes without a success — create, check or secret — and repeats it every fifteen; provisioner.recovered on the next success, on withdrawal, and on the first success after a restart, so the controller can name it in status (hq ADR 0224).
32 lines
944 B
Go
32 lines
944 B
Go
package main
|
|
|
|
// The provisioner loop is carried, identical, by every Go provider until the Go SDK has it
|
|
// (harness.go). Two copies drift the moment one is fixed and the other is not — and the one left
|
|
// behind is the provider that fails a consumer without saying so (novox/hq ADR 0224). This holds
|
|
// them to one text. Skipped where keycloak is not beside this module, as in a build of this one alone.
|
|
|
|
import (
|
|
"bytes"
|
|
"errors"
|
|
"io/fs"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestTheHarnessIsTheSameAsKeycloaks(t *testing.T) {
|
|
theirs, err := os.ReadFile("../../../keycloak/cmd/keycloak-provider/harness.go")
|
|
if errors.Is(err, fs.ErrNotExist) {
|
|
t.Skip("keycloak is not beside this module")
|
|
}
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
ours, err := os.ReadFile("harness.go")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if !bytes.Equal(ours, theirs) {
|
|
t.Fatal("harness.go differs from keycloak/cmd/keycloak-provider/harness.go: change both, identically")
|
|
}
|
|
}
|