internal/pkg: rename measured exec type
All checks were successful
Test / Create distribution (push) Successful in 1m47s
Test / Sandbox (push) Successful in 7m1s
Test / Hakurei (push) Successful in 11m5s
Test / ShareFS (push) Successful in 11m11s
Test / Hakurei (race detector) (push) Successful in 4m45s
Test / Sandbox (race detector) (push) Successful in 9m1s
Test / Flake checks (push) Successful in 4m23s

This type is no longer exclusive to KindExecNet.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-12 15:22:58 +09:00
parent 9f8fafa39b
commit 688d43417b

View File

@@ -162,9 +162,9 @@ type execArtifact struct {
var _ fmt.Stringer = new(execArtifact) var _ fmt.Stringer = new(execArtifact)
// execNetArtifact is like execArtifact but implements [KnownChecksum] and has // execMeasuredArtifact is like execArtifact but implements [KnownChecksum] and
// its resulting container keep the host net namespace. // has its resulting container optionally keep the host net namespace.
type execNetArtifact struct { type execMeasuredArtifact struct {
checksum Checksum checksum Checksum
// Whether to keep host net namespace. // Whether to keep host net namespace.
@@ -173,13 +173,13 @@ type execNetArtifact struct {
execArtifact execArtifact
} }
var _ KnownChecksum = new(execNetArtifact) var _ KnownChecksum = new(execMeasuredArtifact)
// Checksum returns the caller-supplied checksum. // Checksum returns the caller-supplied checksum.
func (a *execNetArtifact) Checksum() Checksum { return a.checksum } func (a *execMeasuredArtifact) Checksum() Checksum { return a.checksum }
// Kind returns [KindExecNet], or [KindExec] if hostNet is false. // Kind returns [KindExecNet], or [KindExec] if hostNet is false.
func (a *execNetArtifact) Kind() Kind { func (a *execMeasuredArtifact) Kind() Kind {
if a == nil || a.hostNet { if a == nil || a.hostNet {
return KindExecNet return KindExecNet
} }
@@ -187,8 +187,8 @@ func (a *execNetArtifact) Kind() Kind {
} }
// Cure cures the [Artifact] in the container described by the caller. The // Cure cures the [Artifact] in the container described by the caller. The
// container retains host networking. // container optionally retains host networking.
func (a *execNetArtifact) Cure(f *FContext) error { func (a *execMeasuredArtifact) Cure(f *FContext) error {
return a.cure(f, a.hostNet) return a.cure(f, a.hostNet)
} }
@@ -251,7 +251,7 @@ func NewExec(
} }
return &a return &a
} }
return &execNetArtifact{*checksum, hostNet, a} return &execMeasuredArtifact{*checksum, hostNet, a}
} }
// Kind returns the hardcoded [Kind] constant. // Kind returns the hardcoded [Kind] constant.
@@ -598,7 +598,7 @@ func (c *Cache) EnterExec(
case *execArtifact: case *execArtifact:
e = f e = f
case *execNetArtifact: case *execMeasuredArtifact:
e = &f.execArtifact e = &f.execArtifact
hostNet = f.hostNet hostNet = f.hostNet