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
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user