manifest: ensure uniqueness of pipeline names
Panic in case two pipelines with the same name are added to the manifest. In the future we should deal with allocating fresh names, but that is not yet needed.
This commit is contained in:
parent
f791bde0e4
commit
5f763dc386
1 changed files with 5 additions and 1 deletions
|
|
@ -35,7 +35,11 @@ func New() Manifest {
|
|||
}
|
||||
|
||||
func (m *Manifest) AddPipeline(p Pipeline) {
|
||||
// TODO: enforce uniqueness - pipelines should have a back pointer to the manifest
|
||||
for _, pipeline := range m.pipelines {
|
||||
if pipeline.Name() == p.Name() {
|
||||
panic("duplicate pipeline name in manifest")
|
||||
}
|
||||
}
|
||||
m.pipelines = append(m.pipelines, p)
|
||||
m.addPackages(p.getPackages())
|
||||
m.addOSTreeCommits(p.getOSTreeCommits())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue