| index b6b8ff7f8..8659750bd 100644 |
| --- a/internal/hostrelocate/pin_envkey_test.go |
| +++ b/internal/hostrelocate/pin_envkey_test.go |
| @@ -127,11 +127,11 @@ func TestStorePinnerKeyEvidence(t *testing.T) { |
| |
| var errUnreadable = errors.New("sentinel: any read error") |
| |
| -// A configured key's record vouches only beside positive evidence that the |
| -// instance's own file supplies no key: the env item with no key of its |
| -// own, or the release flush's deletion entry for it. A manifest that never |
| -// published host.env is not evidence that nothing overrides the |
| -// configuration at launch (absence is never evidence): the pin refuses. |
| +// A configured key's record vouches only beside the env item that shows |
| +// the instance's own file supplies no key. A manifest without host.env is |
| +// not evidence that nothing overrides the configuration at launch (absence |
| +// is never evidence): the pin refuses, and the same record beside an env |
| +// item with no key of its own pins. |
| func TestStorePinnerConfigRecordNeedsTheEnvItem(t *testing.T) { |
| ctx := context.Background() |
| at := time.Date(2026, 10, 7, 9, 0, 0, 0, time.UTC) |
| @@ -139,12 +139,11 @@ func TestStorePinnerConfigRecordNeedsTheEnvItem(t *testing.T) { |
| record := string(instancekey.AdoptionRecord(writer, instancekey.SourceConfig, instancekey.Digest("configured-A"))) |
| for _, tc := range []struct { |
| name string |
| - env string // "", "item" or "deleted" |
| + env string // "" or "item" |
| want error |
| }{ |
| {"an env item never published", "", ErrFilesUnevidenced}, |
| {"an env item with no key of its own", "item", nil}, |
| - {"the flush's deletion entry for the env item", "deleted", nil}, |
| } { |
| t.Run(tc.name, func(t *testing.T) { |
| claims, data := release.NewDirStore(t.TempDir()), release.NewDirStore(t.TempDir()) |
| @@ -161,11 +160,8 @@ func TestStorePinnerConfigRecordNeedsTheEnvItem(t *testing.T) { |
| m.Platform[name] = hostfiles.Entry{Object: obj, SHA256: sha, Size: int64(len(body)), Mode: 0o600, Seq: 4} |
| } |
| item(instancekey.AdoptionItem, record) |
| - switch tc.env { |
| - case "item": |
| + if tc.env == "item" { |
| item(hostfiles.EnvItem, "CARLOS_ADMIN_TOKEN=t\n") |
| - case "deleted": |
| - m.Platform[hostfiles.EnvItem] = hostfiles.Entry{Seq: 4, Deleted: true} |
| } |
| putManifest(t, data, "g3", m) |
| p := StorePinner{Claims: claims, Data: data, Release: routeRelease, Bucket: "data", Region: "ie", SelectDB: selectAt(41)} |