diff --git a/internal/bootstrap/control_test.go b/internal/bootstrap/control_test.go index 7b84df3..ff2fed0 100644 --- a/internal/bootstrap/control_test.go +++ b/internal/bootstrap/control_test.go @@ -307,3 +307,21 @@ func TestABrokerSettingReadFromAFileIsDeliveredToo(t *testing.T) { t.Fatal("a plain path variable was taken for a secret") } } + +// Step 9 with nothing built is a caller's fault, and it stops rather than pretending to pivot. +func TestTheControlPlaneCannotBeInstalledWithoutABuild(t *testing.T) { + runtime := &asked{answer: aMeshThatAgrees(map[string]string{})} + control := controlPlane{container: "temp-mesh-controller", run: runtime.run, timeout: time.Second} + rewritten, err := Rewrite(theRealBundle(t), held) + if err != nil { + t.Fatal(err) + } + _, err = InstallControlPlane(context.Background(), installing(t, t.TempDir()), + Deps{Run: runtime.run}, control, rewritten.Declaration, Built{}, pushedReference, func(string) {}) + if err == nil || !strings.Contains(err.Error(), "was not built") { + t.Fatalf("a missing build was not refused: %v", err) + } + if runtime.ran("module add") { + t.Error("something was registered without a manifest") + } +}