All checks were successful
Test / Create distribution (push) Successful in 43s
Test / Sandbox (push) Successful in 2m18s
Test / Hakurei (push) Successful in 3m10s
Test / Sandbox (race detector) (push) Successful in 3m30s
Test / Hakurei (race detector) (push) Successful in 4m43s
Test / Fpkg (push) Successful in 5m4s
Test / Flake checks (push) Successful in 1m12s
Fortify makes little sense for a container tool. Signed-off-by: Ophestra <cat@gensokyo.uk>
30 lines
647 B
Go
30 lines
647 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
|
|
"git.gensokyo.uk/security/hakurei/hst"
|
|
"git.gensokyo.uk/security/hakurei/internal/app"
|
|
"git.gensokyo.uk/security/hakurei/internal/app/instance"
|
|
"git.gensokyo.uk/security/hakurei/internal/hlog"
|
|
)
|
|
|
|
func mustRunApp(ctx context.Context, config *hst.Config, beforeFail func()) {
|
|
rs := new(app.RunState)
|
|
a := instance.MustNew(instance.ISetuid, ctx, std)
|
|
|
|
var code int
|
|
if sa, err := a.Seal(config); err != nil {
|
|
hlog.PrintBaseError(err, "cannot seal app:")
|
|
code = 1
|
|
} else {
|
|
code = instance.PrintRunStateErr(instance.ISetuid, rs, sa.Run(rs))
|
|
}
|
|
|
|
if code != 0 {
|
|
beforeFail()
|
|
os.Exit(code)
|
|
}
|
|
}
|