Skip to content

Commit fcf3f55

Browse files
committed
Rename actor-id to actor-name
Renamed all occurrences of the deprecated actor-id to actor-name that somehow slipped through the cracks
1 parent a814761 commit fcf3f55

9 files changed

Lines changed: 23 additions & 23 deletions

File tree

cmd/atelet/main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -647,15 +647,15 @@ func (s *AteomHerder) prepareOCIBundles(
647647
spec *ateletpb.WorkloadSpec,
648648
targetAteomUid string,
649649
) error {
650-
// Populate the per-actor nameentity directory that gets bind-mounted into
650+
// Populate the per-actor identity directory that gets bind-mounted into
651651
// the application containers. Regenerated on every resume, so it carries
652652
// the correct per-actor name even when restoring from the golden snapshot.
653653
identityDir := ateompath.ActorIdentityDirPath(atespace, actorName)
654654
if err := os.MkdirAll(identityDir, 0o755); err != nil {
655-
return fmt.Errorf("while creating actor nameentity dir: %w", err)
655+
return fmt.Errorf("while creating actor identity dir: %w", err)
656656
}
657-
if err := writeFileAtomic(filepath.Join(identityDir, ActorIDFileName), []byte(actorName), 0o644); err != nil {
658-
return fmt.Errorf("while writing actor nameentity file: %w", err)
657+
if err := writeFileAtomic(filepath.Join(identityDir, ActorNameFileName), []byte(actorName), 0o644); err != nil {
658+
return fmt.Errorf("while writing actor identity file: %w", err)
659659
}
660660

661661
ddVolumes := make(map[string]bool)
@@ -698,7 +698,7 @@ func (s *AteomHerder) prepareOCIBundles(
698698
nil,
699699
annotations,
700700
ateompath.AteomNetNSPath(targetAteomUid),
701-
"", // pause is sandbox infra; it gets no actor nameentity mount.
701+
"", // pause is sandbox infra; it gets no actor identity mount.
702702
nil,
703703
); err != nil {
704704
return wrapFileSystemErr("while creating pause OCI bundle", err)
@@ -1044,10 +1044,10 @@ func resetActorDirs(atespace, actorName string) error {
10441044
// reads it through the gofer.
10451045
identityDir := ateompath.ActorIdentityDirPath(atespace, actorName)
10461046
if err := os.RemoveAll(identityDir); err != nil {
1047-
return wrapFileSystemErr("while deleting actor nameentity dir: %w", err)
1047+
return wrapFileSystemErr("while deleting actor identity dir: %w", err)
10481048
}
10491049
if err := os.MkdirAll(identityDir, 0o755); err != nil {
1050-
return wrapFileSystemErr("while creating actor nameentity dir: %w", err)
1050+
return wrapFileSystemErr("while creating actor identity dir: %w", err)
10511051
}
10521052

10531053
durableDirVolumesMountDir := ateompath.DurableDirVolumeMountsDir(atespace, actorName)

cmd/atelet/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939

4040
func TestWriteFileAtomic(t *testing.T) {
4141
dir := t.TempDir()
42-
target := filepath.Join(dir, "actor-id")
42+
target := filepath.Join(dir, "actor-name")
4343

4444
// One shared write over an existing value, as happens on every resume;
4545
// each subtest checks one postcondition.

cmd/atelet/oci.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ const (
4949
// changing the mount shape.
5050
IdentityMountPath = "/run/ate"
5151

52-
// ActorIDFileName is the file inside IdentityMountPath holding the
53-
// actor's own ID, raw with no trailing newline.
54-
ActorIDFileName = "actor-id"
52+
// ActorNameFileName is the file inside IdentityMountPath holding the
53+
// actor's own name, raw with no trailing newline.
54+
ActorNameFileName = "actor-name"
5555
)
5656

5757
func prepareOCIDirectory(ctx context.Context, pullCache *memorypullcache.MemoryPullCache, atespace, actorName, containerName, ref string, args []string, env []string, annotations map[string]string, netns string, identityDir string, durableDirVolumeMounts []*ateletpb.VolumeMount) error {
@@ -82,8 +82,8 @@ func prepareOCIDirectory(ctx context.Context, pullCache *memorypullcache.MemoryP
8282
return fmt.Errorf("in untar: %w", err)
8383
}
8484

85-
// Bind-mount the per-actor nameentity directory so the workload can read its
86-
// own ID at IdentityMountPath/ActorIDFileName. The bind target must exist
85+
// Bind-mount the per-actor identity directory so the workload can read its
86+
// own name at IdentityMountPath/ActorNameFileName. The bind target must exist
8787
// in the rootfs for the mount to attach.
8888
if identityDir != "" {
8989
if err := createMountPoint(rootPath, IdentityMountPath); err != nil {

cmd/atelet/oci_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestBuildActorOCISpec_IdentityMount(t *testing.T) {
103103
}
104104
found = true
105105
if m.Source != "/host/actors/atespace:id/identity" {
106-
t.Errorf("identity mount source = %q, want the per-actor nameentity dir", m.Source)
106+
t.Errorf("identity mount source = %q, want the per-actor identity dir", m.Source)
107107
}
108108
if m.Type != "bind" {
109109
t.Errorf("identity mount type = %q, want bind", m.Type)

cmd/ateom-microvm/spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func ensureKataCompatibleSpec(bundle, id, netnsPath string) (*specs.Spec, error)
8989
// agent accepts. (Static shaper; pod DNS integration is future work.)
9090
//
9191
// KNOWN GAP vs the gVisor runtime: this also drops atelet's read-only actor
92-
// identity bind mount (/run/ate/actor-id). The micro-VM guest can't see host
92+
// identity bind mount (/run/ate/actor-name). The micro-VM guest can't see host
9393
// paths (the rootfs is an overlay of a virtio-fs base + a guest-RAM upper, not a
9494
// host bind), so atelet's host-path identity mount has nothing to bind to.
9595
// Exposing the identity needs a per-actor volume plumbed into the guest; not yet

docs/api-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ Because a snapshot is not restorable across sandbox runtimes, `sandboxClass` is
101101
Container environment variables support literal `value` entries and `valueFrom.secretKeyRef`. Secret references are resolved by `ate-api-server` from the `ActorTemplate` namespace when a workload spec is materialized. For the golden actor, the resolved values are captured in the golden snapshot and future actors inherit those values until the golden snapshot is recreated. For an actor that bypasses the golden snapshot and boots from the current template spec, the resolved values are sent to atelet but are not serialized into the public Actor API. Other Kubernetes `valueFrom` sources are not supported yet. Secret changes do not automatically restart actors or invalidate snapshots; rotating a Secret requires an explicit actor or template lifecycle action.
102102

103103
### Workload Connectivity (Uniform DNS)
104-
Substrate uses a **Uniform DNS Mesh**: every actor created from a template is automatically reachable through the **Substrate Router** via its atespace and ID:
104+
Substrate uses a **Uniform DNS Mesh**: every actor created from a template is automatically reachable through the **Substrate Router** via its atespace and name:
105105

106-
**Format:** `<actor-id>.<atespace>.actors.resources.substrate.ate.dev`
106+
**Format:** `<actor-name>.<atespace>.actors.resources.substrate.ate.dev`
107107

108108
### Actor Identity
109-
Substrate bind-mounts a read-only, per-actor identity directory at **`/run/ate`** into each of the actor's containers. An actor can learn its own ID without parsing the `Host` header by reading the file **`/run/ate/actor-id`** inside it, which contains the raw actor ID with no trailing newline. Further identity and configuration data may appear in this directory over time.
109+
Substrate bind-mounts a read-only, per-actor identity directory at **`/run/ate`** into each of the actor's containers. An actor can learn its own name without parsing the `Host` header by reading the file **`/run/ate/actor-name`** inside it, which contains the raw actor name with no trailing newline. Further identity and configuration data may appear in this directory over time.
110110

111-
Read it fresh rather than caching it at process start. It is delivered as a per-actor bind mount, not an environment variable, precisely so it carries the correct ID after a resume from the golden snapshot — an env var (or a file baked into the image) would be frozen at the *golden* actor's ID, since it lives in the checkpointed process memory, and would therefore be identical for every actor of the template.
111+
Read it fresh rather than caching it at process start. It is delivered as a per-actor bind mount, not an environment variable, precisely so it carries the correct name after a resume from the golden snapshot — an env var (or a file baked into the image) would be frozen at the *golden* actor's name, since it lives in the checkpointed process memory, and would therefore be identical for every actor of the template.
112112

113113
### Container Readiness Probe (`readyz`)
114114

internal/ateompath/ateompath.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func ActorPath(atespace, actorName string) string {
6969
}
7070

7171
// ActorIdentityDirPath is the host directory atelet populates with the
72-
// actor's identity data (currently the single file "actor-id") and
72+
// actor's identity data (currently the single file "actor-name") and
7373
// bind-mounts read-only into the actor. It is per-actor and regenerated on
7474
// every resume, so (unlike the checkpointed process environment) it reflects
7575
// the correct ID after a restore from the golden snapshot.

internal/e2e/fixtures/probe/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727
"os"
2828
)
2929

30-
// identityFile is the actor-id file inside the identity directory atelet
30+
// identityFile is the actor-name file inside the identity directory atelet
3131
// bind-mounts at IdentityMountPath.
32-
const identityFile = "/run/ate/actor-id"
32+
const identityFile = "/run/ate/actor-name"
3333

3434
// whoami reports the actor's identity as observed at request time from the
3535
// bind-mounted identity file. A read failure is reported in the response

internal/e2e/suites/identity/identity_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func TestActorIdentity_AfterRestore_IsOwnID_NotGolden(t *testing.T) {
7878
got := whoami(t, ctx, rc, id)
7979

8080
if got.File != id {
81-
t.Errorf("actor %q: /run/ate/actor-id = %q, want %q (probe read error: %q)", id, got.File, id, got.Error)
81+
t.Errorf("actor %q: /run/ate/actor-name = %q, want %q (probe read error: %q)", id, got.File, id, got.Error)
8282
}
8383
if got.File == golden {
8484
t.Errorf("actor %q: identity is the GOLDEN snapshot id %q — restore leaked shared state", id, golden)

0 commit comments

Comments
 (0)