internal/app: apply pd behaviour to outcomeState
Some checks failed
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m15s
Test / Hpkg (push) Successful in 4m5s
Test / Sandbox (race detector) (push) Successful in 4m23s
Test / Hakurei (push) Failing after 1m41s
Test / Hakurei (race detector) (push) Failing after 1m55s
Test / Flake checks (push) Has been skipped
Some checks failed
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m15s
Test / Hpkg (push) Successful in 4m5s
Test / Sandbox (race detector) (push) Successful in 4m23s
Test / Hakurei (push) Failing after 1m41s
Test / Hakurei (race detector) (push) Failing after 1m55s
Test / Flake checks (push) Has been skipped
This avoids needlessly clobbering hst.Config. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
8ace214832
commit
4ea43ba30f
@ -102,14 +102,22 @@ func (k *outcome) finalise(ctx context.Context, msg container.Msg, id *state.ID,
|
||||
}
|
||||
}
|
||||
|
||||
s := outcomeState{
|
||||
ID: id,
|
||||
Identity: config.Identity,
|
||||
UserID: (&Hsu{k: k}).MustIDMsg(msg),
|
||||
EnvPaths: copyPaths(k.syscallDispatcher),
|
||||
Container: config.Container,
|
||||
}
|
||||
|
||||
// permissive defaults
|
||||
if config.Container == nil {
|
||||
if s.Container == nil {
|
||||
msg.Verbose("container configuration not supplied, PROCEED WITH CAUTION")
|
||||
|
||||
if config.Shell == nil {
|
||||
config.Shell = container.AbsFHSRoot.Append("bin", "sh")
|
||||
s, _ := k.lookupEnv("SHELL")
|
||||
if a, err := container.NewAbs(s); err == nil {
|
||||
shell, _ := k.lookupEnv("SHELL")
|
||||
if a, err := container.NewAbs(shell); err == nil {
|
||||
config.Shell = a
|
||||
}
|
||||
}
|
||||
@ -166,7 +174,7 @@ func (k *outcome) finalise(ctx context.Context, msg container.Msg, id *state.ID,
|
||||
}},
|
||||
)
|
||||
|
||||
config.Container = conf
|
||||
s.Container = conf
|
||||
}
|
||||
|
||||
// late nil checks for pd behaviour
|
||||
@ -179,23 +187,14 @@ func (k *outcome) finalise(ctx context.Context, msg container.Msg, id *state.ID,
|
||||
|
||||
// enforce bounds and default early
|
||||
kp.waitDelay = shimWaitTimeout
|
||||
if config.Container.WaitDelay <= 0 {
|
||||
if s.Container.WaitDelay <= 0 {
|
||||
kp.waitDelay += DefaultShimWaitDelay
|
||||
} else if config.Container.WaitDelay > MaxShimWaitDelay {
|
||||
} else if s.Container.WaitDelay > MaxShimWaitDelay {
|
||||
kp.waitDelay += MaxShimWaitDelay
|
||||
} else {
|
||||
kp.waitDelay += config.Container.WaitDelay
|
||||
kp.waitDelay += s.Container.WaitDelay
|
||||
}
|
||||
|
||||
s := outcomeState{
|
||||
ID: id,
|
||||
Identity: config.Identity,
|
||||
UserID: (&Hsu{k: k}).MustIDMsg(msg),
|
||||
EnvPaths: copyPaths(k.syscallDispatcher),
|
||||
|
||||
// TODO(ophestra): apply pd behaviour here instead of clobbering hst.Config
|
||||
Container: config.Container,
|
||||
}
|
||||
if s.Container.MapRealUID {
|
||||
s.Mapuid, s.Mapgid = k.getuid(), k.getgid()
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user