Skip to content

Commit

Permalink
manager/deploy: do not allow deploying of empty topology (#994)
Browse files Browse the repository at this point in the history
Co-authored-by: SIGSEGV <[email protected]>
Co-authored-by: Ti Prow Robot <[email protected]>
  • Loading branch information
3 people authored Dec 17, 2020
1 parent 1557d4a commit 295ade4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/cluster/manager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ func (m *Manager) Deploy(
return err
}

instCnt := 0
topo.IterInstance(func(inst spec.Instance) {
switch inst.ComponentName() {
// monitoring components are only useful when deployed with
// core components, we do not support deploying any bare
// monitoring system.
case spec.ComponentGrafana,
spec.ComponentPrometheus,
spec.ComponentAlertmanager:
return
}
instCnt++
})
if instCnt < 1 {
return fmt.Errorf("no valid instance found in the input topology, please check your config")
}

spec.ExpandRelativeDir(topo)

base := topo.BaseTopo()
Expand Down

0 comments on commit 295ade4

Please sign in to comment.