Merge pull request #55 from hongchaodeng/master
implement cluster creation
This commit is contained in:
Коммит
05ef6596ca
10
cluster.go
10
cluster.go
|
@ -113,20 +113,12 @@ func (c *Cluster) create(spec *Spec) {
|
|||
members := MemberSet{}
|
||||
c.spec = spec
|
||||
// we want to make use of member's utility methods.
|
||||
for i := 0; i < c.spec.Size; i++ {
|
||||
etcdName := fmt.Sprintf("%s-%04d", c.name, i)
|
||||
etcdName := fmt.Sprintf("%s-%04d", c.name, 0)
|
||||
members.Add(&Member{Name: etcdName})
|
||||
}
|
||||
|
||||
// TODO: parallelize it
|
||||
for i := 0; i < c.spec.Size; i++ {
|
||||
etcdName := fmt.Sprintf("%s-%04d", c.name, i)
|
||||
if err := c.createPodAndService(members, members[etcdName], "new"); err != nil {
|
||||
panic(fmt.Sprintf("(TODO: we need to clean up already created ones.)\nError: %v", err))
|
||||
}
|
||||
c.idCounter++
|
||||
}
|
||||
|
||||
fmt.Println("created cluster:", members)
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче