Skip to content

Commit

Permalink
feat: bump chisel.yaml format version to "chisel-v2"
Browse files Browse the repository at this point in the history
This commit introduces a new chisel-release yaml format named
"chisel-v2". The major changes in this format is the introduction of the
"public-keys" field, which is used in archive definitions to verify
archive InRelease files.
  • Loading branch information
rebornplusplus authored and letFunny committed Dec 14, 2023
1 parent ff4fa92 commit eeab8d1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ archives:
Example:
```yaml
format: chisel-v1
format: chisel-v2

archives:
ubuntu:
Expand Down
2 changes: 1 addition & 1 deletion internal/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ type yamlRelease struct {
PublicKeys map[string]yamlPublicKey `yaml:"public-keys"`
}

const yamlReleaseFormat = "chisel-v1"
const yamlReleaseFormat = "chisel-v2"

type yamlArchive struct {
Version string `yaml:"version"`
Expand Down
20 changes: 10 additions & 10 deletions internal/setup/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ var setupTests = []setupTest{{
format: foobar
`,
},
relerror: `chisel.yaml: expected format "chisel-v1", got "foobar"`,
relerror: `chisel.yaml: expected format "chisel-v2", got "foobar"`,
}, {
summary: "Missing archives",
input: map[string]string{
"chisel.yaml": `
format: chisel-v1
format: chisel-v2
`,
},
relerror: `chisel.yaml: no archives defined`,
Expand All @@ -54,7 +54,7 @@ var setupTests = []setupTest{{
summary: "Archive with multiple suites",
input: map[string]string{
"chisel.yaml": `
format: chisel-v1
format: chisel-v2
archives:
ubuntu:
version: 22.04
Expand Down Expand Up @@ -767,7 +767,7 @@ var setupTests = []setupTest{{
summary: "Multiple archives",
input: map[string]string{
"chisel.yaml": `
format: chisel-v1
format: chisel-v2
archives:
foo:
version: 22.04
Expand Down Expand Up @@ -879,7 +879,7 @@ var setupTests = []setupTest{{
summary: "Archives with public keys",
input: map[string]string{
"chisel.yaml": `
format: chisel-v1
format: chisel-v2
archives:
foo:
version: 22.04
Expand Down Expand Up @@ -936,7 +936,7 @@ var setupTests = []setupTest{{
summary: "Archive without public keys",
input: map[string]string{
"chisel.yaml": `
format: chisel-v1
format: chisel-v2
archives:
foo:
version: 22.04
Expand All @@ -950,7 +950,7 @@ var setupTests = []setupTest{{
summary: "Unknown public key",
input: map[string]string{
"chisel.yaml": `
format: chisel-v1
format: chisel-v2
archives:
foo:
version: 22.04
Expand All @@ -968,7 +968,7 @@ var setupTests = []setupTest{{
summary: "Invalid public key",
input: map[string]string{
"chisel.yaml": `
format: chisel-v1
format: chisel-v2
archives:
foo:
version: 22.04
Expand Down Expand Up @@ -996,7 +996,7 @@ var setupTests = []setupTest{{
summary: "Mismatched public key ID",
input: map[string]string{
"chisel.yaml": `
format: chisel-v1
format: chisel-v2
archives:
foo:
version: 22.04
Expand All @@ -1017,7 +1017,7 @@ var setupTests = []setupTest{{
}}

var defaultChiselYaml = `
format: chisel-v1
format: chisel-v2
archives:
ubuntu:
version: 22.04
Expand Down
4 changes: 2 additions & 2 deletions internal/slicer/slicer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ var slicerTests = []slicerTest{{
slices: []setup.SliceKey{{"base-files", "myslice"}},
release: map[string]string{
"chisel.yaml": `
format: chisel-v1
format: chisel-v2
archives:
foo:
version: 22.04
Expand Down Expand Up @@ -528,7 +528,7 @@ var slicerTests = []slicerTest{{
}}

var defaultChiselYaml = `
format: chisel-v1
format: chisel-v2
archives:
ubuntu:
version: 22.04
Expand Down

0 comments on commit eeab8d1

Please sign in to comment.