Skip to content

Commit

Permalink
Remove fs_index version/entry_key check
Browse files Browse the repository at this point in the history
* Fixes `Internal inconsistency: version 'qwertyuiopsha' vs '2' errors

[#132106783]

Signed-off-by: Ming Xiao <[email protected]>
  • Loading branch information
Rob Day-Reynolds authored and Ming Xiao committed Oct 11, 2016
1 parent f48a284 commit 57771c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions releasedir/index/fs_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,6 @@ func (i FSIndex) entries(name string) ([]indexEntry, error) {
var entries []indexEntry

for versionKey, entry := range schema.Builds {
if versionKey != entry.Version {
return nil, bosherr.Errorf("Internal inconsistency: version '%s' vs '%s'", versionKey, entry.Version)
}

entries = append(entries, indexEntry{
Key: versionKey,
Version: entry.Version,
Expand Down
5 changes: 2 additions & 3 deletions releasedir/index/fs_index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,14 @@ format-version: "2"`)
Expect(err).To(Equal(errors.New("fake-err")))
})

It("returns error if found entry does not have matching version with its build key", func() {
It("does not require version to equal entry key", func() {
fs.WriteFileString("/dir/name/index.yml", `---
builds:
fp: {version: other-fp}
format-version: "2"`)

_, _, err := index.Find("name", "fp")
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("Internal inconsistency: version 'fp' vs 'other-fp'"))
Expect(err).ToNot(HaveOccurred())
})

It("returns error if name is empty", func() {
Expand Down

0 comments on commit 57771c2

Please sign in to comment.