Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The manifest_version should default to 1 if missing. #214

Merged
merged 4 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/compute/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (f *File) Read(fpath string) error {
f.exists = true

if f.ManifestVersion.int == 0 {
return errors.ErrMissingManifestVersion
f.ManifestVersion.int = 1
}

return nil
Expand Down
7 changes: 3 additions & 4 deletions pkg/compute/manifest/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ func TestManifest(t *testing.T) {
manifest: "fastly-valid-integer.toml",
valid: true,
},
"invalid: missing manifest_version": {
manifest: "fastly-invalid-missing-version.toml",
valid: false,
expectedError: errs.ErrMissingManifestVersion,
"invalid: missing manifest_version causes default to be set": {
manifest: "fastly-invalid-missing-version.toml",
valid: true,
},
"invalid: manifest_version Atoi error": {
manifest: "fastly-invalid-unrecognised.toml",
Expand Down