mesh-build-image: let the module's own guard decide whether the real-buildah tests run, so a check sandbox where rootless buildah cannot unshare skips them loudly instead of failing every catalogue check (issue 1894)
This commit is contained in:
@@ -53,6 +53,11 @@ func realModule(t *testing.T) (*Module, *keptStates) {
|
|||||||
m := &Module{Node: "ace", Account: u.Username, UID: u.Uid, Home: home, Work: t.TempDir(), Store: t.TempDir(),
|
m := &Module{Node: "ace", Account: u.Username, UID: u.Uid, Home: home, Work: t.TempDir(), Store: t.TempDir(),
|
||||||
Steps: states.putStep, Ctx: context.Background(), Say: t.Logf, Run: StepRunner(home),
|
Steps: states.putStep, Ctx: context.Background(), Say: t.Logf, Run: StepRunner(home),
|
||||||
FetchOptions: []buildstep.Option{buildstep.AllowFileRemote()}}
|
FetchOptions: []buildstep.Option{buildstep.AllowFileRemote()}}
|
||||||
|
// buildah being installed is not enough: inside the check's sandbox rootless buildah cannot make its user
|
||||||
|
// namespace, so the module's own guard decides, as it does before every step (issue 1894).
|
||||||
|
if err := m.Check(context.Background()); err != nil {
|
||||||
|
t.Skipf("NOT RUN: this machine cannot build images where the check runs (%v); proven live on a build node", err)
|
||||||
|
}
|
||||||
return m, states
|
return m, states
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user