internal/app: copy parts of config to state
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m12s
Test / Hakurei (push) Successful in 3m7s
Test / Hpkg (push) Successful in 4m4s
Test / Sandbox (race detector) (push) Successful in 4m30s
Test / Hakurei (race detector) (push) Successful in 5m20s
Test / Flake checks (push) Successful in 1m34s
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m12s
Test / Hakurei (push) Successful in 3m7s
Test / Hpkg (push) Successful in 4m4s
Test / Sandbox (race detector) (push) Successful in 4m30s
Test / Hakurei (race detector) (push) Successful in 5m20s
Test / Flake checks (push) Successful in 1m34s
This is less error-prone than passing the address to the entire hst.Config struct, and reduces the likelihood of accidentally clobbering hst.Config. This also improves ease of testing. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -13,15 +13,15 @@ import (
|
||||
"hakurei.app/system/acl"
|
||||
)
|
||||
|
||||
func init() { gob.Register(spFinal{}) }
|
||||
func init() { gob.Register(spFinalOp{}) }
|
||||
|
||||
// spFinal is a transitional op destined for removal after #3, #8, #9 has been resolved.
|
||||
// spFinalOp is a transitional op destined for removal after #3, #8, #9 has been resolved.
|
||||
// It exists to avoid reordering the expected entries in test cases.
|
||||
type spFinal struct{}
|
||||
type spFinalOp struct{}
|
||||
|
||||
func (s spFinal) toSystem(state *outcomeStateSys) error {
|
||||
func (s spFinalOp) toSystem(state *outcomeStateSys) error {
|
||||
// append ExtraPerms last
|
||||
for _, p := range state.config.ExtraPerms {
|
||||
for _, p := range state.extraPerms {
|
||||
if p == nil || p.Path == nil {
|
||||
continue
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func (s spFinal) toSystem(state *outcomeStateSys) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s spFinal) toContainer(state *outcomeStateParams) error {
|
||||
func (s spFinalOp) toContainer(state *outcomeStateParams) error {
|
||||
// TODO(ophestra): move this to spFilesystemOp after #8 and #9
|
||||
|
||||
// mount root read-only as the final setup Op
|
||||
|
||||
Reference in New Issue
Block a user