Skip to content

Commit

Permalink
Fix the dependencies field to match the specification (#953)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove authored Dec 2, 2020
1 parent 601a3e0 commit 4e336b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions pkg/repository/v1manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ var ManifestsConfig = map[string]ty{
},
}

var knownVersions = map[string]struct{}{"0.1.0": {}}
var knownVersions = map[string]bool{
"0.1.0": true,
}

// AddSignature adds one or more signatures to the manifest
func (manifest *Manifest) AddSignature(sigs []Signature) {
Expand Down Expand Up @@ -201,7 +203,7 @@ func (s *SignedBase) isValid(filename string) error {
return fmt.Errorf("unknown manifest type: `%s`", s.Ty)
}

if _, ok := knownVersions[s.SpecVersion]; !ok {
if !knownVersions[s.SpecVersion] {
return fmt.Errorf("unknown manifest version: `%s`, you might need to update TiUp", s.SpecVersion)
}

Expand Down
10 changes: 5 additions & 5 deletions pkg/repository/v1manifest/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ type Owner struct {

// VersionItem is the manifest structure of a version of a component
type VersionItem struct {
URL string `json:"url"`
Yanked bool `json:"yanked"`
Entry string `json:"entry"`
Released string `json:"released"`
Dependencies []string `json:"dependencies"`
URL string `json:"url"`
Yanked bool `json:"yanked"`
Entry string `json:"entry"`
Released string `json:"released"`
Dependencies map[string]string `json:"dependencies"`

FileHash
}
Expand Down

0 comments on commit 4e336b2

Please sign in to comment.