Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions index/generator/library/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ func validateIndexComponent(indexComponent schema.Schema, componentType schema.D
if indexComponent.Git == nil {
return fmt.Errorf("index component git is empty")
}
if len(indexComponent.Git.Remotes) > 1 {
return fmt.Errorf("index component has multiple remotes")
}
}

return nil
Expand Down
14 changes: 14 additions & 0 deletions index/generator/library/library_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ func TestValidateIndexComponent(t *testing.T) {
schema.SampleDevfileType,
false,
},
{
"Case 7: test index component git has multiple remotes",
schema.Schema{
Name: "nodejs",
Git: &schema.Git{
Remotes: map[string]string{
"origin": "https://github.com/redhat-developer/devfile-sample",
"test": "https://github.com/redhat-developer/test",
},
},
},
schema.SampleDevfileType,
true,
},
}

for _, tt := range tests {
Expand Down