From 688d43417b4f3d3970d6798baa1aeee20a8b7d5c Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 12 May 2026 15:22:58 +0900 Subject: [PATCH] internal/pkg: rename measured exec type This type is no longer exclusive to KindExecNet. Signed-off-by: Ophestra --- internal/pkg/exec.go | 20 ++++++++++---------- 1 file 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