aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/exec.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-12 15:22:58 +0900
committerOphestra <cat@gensokyo.uk>2026-05-12 15:23:33 +0900
commit688d43417b4f3d3970d6798baa1aeee20a8b7d5c (patch)
treec442334a2da3e2f875101ef5ceac96cc98f27554 /internal/pkg/exec.go
parent9f8fafa39b9e737dfd5a7b1f7920d51f3742f2b8 (diff)
internal/pkg: rename measured exec type
This type is no longer exclusive to KindExecNet. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/exec.go')
-rw-r--r--internal/pkg/exec.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/pkg/exec.go b/internal/pkg/exec.go
index c0ea7485..ceb75fef 100644
--- a/internal/pkg/exec.go
+++ b/internal/pkg/exec.go
@@ -162,9 +162,9 @@ type execArtifact struct {
var _ fmt.Stringer = new(execArtifact)
-// execNetArtifact is like execArtifact but implements [KnownChecksum] and has
-// its resulting container keep the host net namespace.
-type execNetArtifact struct {
+// execMeasuredArtifact is like execArtifact but implements [KnownChecksum] and
+// has its resulting container optionally keep the host net namespace.
+type execMeasuredArtifact struct {
checksum Checksum
// Whether to keep host net namespace.
@@ -173,13 +173,13 @@ type execNetArtifact struct {
execArtifact
}
-var _ KnownChecksum = new(execNetArtifact)
+var _ KnownChecksum = new(execMeasuredArtifact)
// 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.
-func (a *execNetArtifact) Kind() Kind {
+func (a *execMeasuredArtifact) Kind() Kind {
if a == nil || a.hostNet {
return KindExecNet
}
@@ -187,8 +187,8 @@ func (a *execNetArtifact) Kind() Kind {
}
// Cure cures the [Artifact] in the container described by the caller. The
-// container retains host networking.
-func (a *execNetArtifact) Cure(f *FContext) error {
+// container optionally retains host networking.
+func (a *execMeasuredArtifact) Cure(f *FContext) error {
return a.cure(f, a.hostNet)
}
@@ -251,7 +251,7 @@ func NewExec(
}
return &a
}
- return &execNetArtifact{*checksum, hostNet, a}
+ return &execMeasuredArtifact{*checksum, hostNet, a}
}
// Kind returns the hardcoded [Kind] constant.
@@ -598,7 +598,7 @@ func (c *Cache) EnterExec(
case *execArtifact:
e = f
- case *execNetArtifact:
+ case *execMeasuredArtifact:
e = &f.execArtifact
hostNet = f.hostNet