Skip to content

Commit

Permalink
rename yaml key to v1-public-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
letFunny committed Jan 11, 2024
1 parent b78f108 commit c4ef62e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions internal/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
36 changes: 18 additions & 18 deletions internal/setup/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") + `
Expand Down Expand Up @@ -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") + `
Expand Down Expand Up @@ -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") + `
Expand Down Expand Up @@ -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") + `
Expand Down Expand Up @@ -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{
Expand All @@ -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": `
Expand All @@ -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: |
Expand All @@ -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") + `
Expand All @@ -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") + `
Expand Down
10 changes: 5 additions & 5 deletions internal/slicer/slicer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") + `
Expand All @@ -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") + `
Expand Down

0 comments on commit c4ef62e

Please sign in to comment.