1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-25 06:33:56 +00:00

Cluster Down/Remove

Reverse order and add force flag
This commit is contained in:
galal-hussein
2017-11-20 20:08:50 +02:00
parent e53f7adf02
commit 892e9ab5d9
13 changed files with 329 additions and 67 deletions

View File

@@ -25,6 +25,18 @@ func RunEtcdPlane(etcdHosts []hosts.Host, etcdService v1.ETCDService) error {
return nil
}
func RemoveEtcdPlane(etcdHosts []hosts.Host) error {
logrus.Infof("[%s] Tearing down Etcd Plane..", ETCDRole)
for _, host := range etcdHosts {
err := docker.DoRemoveContainer(host.DClient, EtcdContainerName, host.AdvertisedHostname)
if err != nil {
return err
}
}
logrus.Infof("[%s] Successfully teared down Etcd Plane..", ETCDRole)
return nil
}
func buildEtcdConfig(host hosts.Host, etcdService v1.ETCDService, initCluster string) (*container.Config, *container.HostConfig) {
imageCfg := &container.Config{
Image: etcdService.Image,