Remove some dead code

This commit is contained in:
Justin Santa Barbara 2016-09-17 14:49:17 -04:00
parent 5148e2c2f9
commit 414e4ddfbe
1 changed files with 0 additions and 38 deletions

View File

@ -306,44 +306,6 @@ func CreateClusterConfig(clusterRegistry *ClusterRegistry, cluster *Cluster, gro
return nil
}
func UpdateClusterConfig(clusterRegistry *ClusterRegistry, cluster *Cluster, groups []*InstanceGroup) error {
// Check for instancegroup Name duplicates before writing
// TODO: Move to deep-validate, DRY with CreateClusterConfig
{
names := map[string]bool{}
for i, ns := range groups {
if ns.Name == "" {
return fmt.Errorf("InstanceGroup #%d did not have a Name", i+1)
}
if names[ns.Name] {
return fmt.Errorf("Duplicate InstanceGroup Name found: %q", ns.Name)
}
names[ns.Name] = true
}
}
clusterName := cluster.Name
igRegistry, err := clusterRegistry.InstanceGroups(clusterName)
if err != nil {
return fmt.Errorf("error getting instance group registry: %v", err)
}
err = clusterRegistry.Update(cluster)
if err != nil {
return err
}
for _, ig := range groups {
err = igRegistry.Update(ig)
if err != nil {
return fmt.Errorf("error writing updated instancegroup configuration: %v", err)
}
}
return nil
}
func (r *ClusterRegistry) DeleteAllClusterState(clusterName string) error {
if clusterName == "" {
return fmt.Errorf("clusterName is required")