diff --git a/internal/setup/setup.go b/internal/setup/setup.go index 32d81d16..e04f8eca 100644 --- a/internal/setup/setup.go +++ b/internal/setup/setup.go @@ -321,7 +321,7 @@ func readSlices(release *Release, baseDir, dirName string) error { type yamlRelease struct { Format string `yaml:"format"` Archives map[string]yamlArchive `yaml:"archives"` - PubKeys map[string]yamlPubKey `yaml:"public-keys"` + PubKeys map[string]yamlPubKey `yaml:"v1-public-keys"` } const yamlReleaseFormat = "chisel-v1" @@ -331,7 +331,7 @@ type yamlArchive struct { Suites []string `yaml:"suites"` Components []string `yaml:"components"` Default bool `yaml:"default"` - PubKeys []string `yaml:"public-keys"` + PubKeys []string `yaml:"v1-public-keys"` } type yamlPackage struct { @@ -460,7 +460,7 @@ func parseRelease(baseDir, filePath string, data []byte) (*Release, error) { release.DefaultArchive = archiveName } if len(details.PubKeys) == 0 { - return nil, fmt.Errorf("%s: archive %q missing public-keys field", fileName, archiveName) + return nil, fmt.Errorf("%s: archive %q missing v1-public-keys field", fileName, archiveName) } var archiveKeys []*packet.PublicKey for _, keyName := range details.PubKeys { diff --git a/internal/setup/setup_test.go b/internal/setup/setup_test.go index f2f53c7a..9bbf444b 100644 --- a/internal/setup/setup_test.go +++ b/internal/setup/setup_test.go @@ -60,8 +60,8 @@ var setupTests = []setupTest{{ version: 22.04 components: [main, other] suites: [jammy, jammy-security] - public-keys: [test-key] - public-keys: + v1-public-keys: [test-key] + v1-public-keys: test-key: id: ` + testKey.ID + ` armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + ` @@ -774,13 +774,13 @@ var setupTests = []setupTest{{ components: [main, universe] suites: [jammy] default: true - public-keys: [test-key] + v1-public-keys: [test-key] bar: version: 22.04 components: [universe] suites: [jammy-updates] - public-keys: [test-key] - public-keys: + v1-public-keys: [test-key] + v1-public-keys: test-key: id: ` + testKey.ID + ` armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + ` @@ -827,10 +827,10 @@ var setupTests = []setupTest{{ version: 22.04 components: [main, other] suites: [jammy, jammy-security] - public-keys: [test-key] + v1-public-keys: [test-key] madeUpKey1: whatever madeUpKey2: whatever - public-keys: + v1-public-keys: test-key: id: ` + testKey.ID + ` armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + ` @@ -885,14 +885,14 @@ var setupTests = []setupTest{{ version: 22.04 components: [main, universe] suites: [jammy] - public-keys: [extra-key] + v1-public-keys: [extra-key] default: true bar: version: 22.04 components: [universe] suites: [jammy-updates] - public-keys: [test-key, extra-key] - public-keys: + v1-public-keys: [test-key, extra-key] + v1-public-keys: extra-key: id: ` + extraTestKey.ID + ` armor: |` + "\n" + testutil.PrefixEachLine(extraTestKey.PubKeyArmor, "\t\t\t\t\t\t") + ` @@ -945,7 +945,7 @@ var setupTests = []setupTest{{ default: true `, }, - relerror: `chisel.yaml: archive "foo" missing public-keys field`, + relerror: `chisel.yaml: archive "foo" missing v1-public-keys field`, }, { summary: "Unknown public key", input: map[string]string{ @@ -956,7 +956,7 @@ var setupTests = []setupTest{{ version: 22.04 components: [main, universe] suites: [jammy] - public-keys: [extra-key] + v1-public-keys: [extra-key] default: true `, "slices/mydir/mypkg.yaml": ` @@ -974,9 +974,9 @@ var setupTests = []setupTest{{ version: 22.04 components: [main, universe] suites: [jammy] - public-keys: [extra-key] + v1-public-keys: [extra-key] default: true - public-keys: + v1-public-keys: extra-key: id: foo armor: | @@ -1002,9 +1002,9 @@ var setupTests = []setupTest{{ version: 22.04 components: [main, universe] suites: [jammy] - public-keys: [extra-key] + v1-public-keys: [extra-key] default: true - public-keys: + v1-public-keys: extra-key: id: ` + extraTestKey.ID + ` armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + ` @@ -1022,8 +1022,8 @@ var defaultChiselYaml = ` ubuntu: version: 22.04 components: [main, universe] - public-keys: [test-key] - public-keys: + v1-public-keys: [test-key] + v1-public-keys: test-key: id: ` + testKey.ID + ` armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + ` diff --git a/internal/slicer/slicer_test.go b/internal/slicer/slicer_test.go index 3d5df59d..48e21bf1 100644 --- a/internal/slicer/slicer_test.go +++ b/internal/slicer/slicer_test.go @@ -501,12 +501,12 @@ var slicerTests = []slicerTest{{ version: 22.04 components: [main, universe] default: true - public-keys: [test-key] + v1-public-keys: [test-key] bar: version: 22.04 components: [main] - public-keys: [test-key] - public-keys: + v1-public-keys: [test-key] + v1-public-keys: test-key: id: ` + testKey.ID + ` armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + ` @@ -533,8 +533,8 @@ var defaultChiselYaml = ` ubuntu: version: 22.04 components: [main, universe] - public-keys: [test-key] - public-keys: + v1-public-keys: [test-key] + v1-public-keys: test-key: id: ` + testKey.ID + ` armor: |` + "\n" + testutil.PrefixEachLine(testKey.PubKeyArmor, "\t\t\t\t\t\t") + `