mirror of https://github.com/kubernetes/kops.git
Remove some dead code
This commit is contained in:
parent
5148e2c2f9
commit
414e4ddfbe
|
|
@ -306,44 +306,6 @@ func CreateClusterConfig(clusterRegistry *ClusterRegistry, cluster *Cluster, gro
|
||||||
return nil
|
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 {
|
func (r *ClusterRegistry) DeleteAllClusterState(clusterName string) error {
|
||||||
if clusterName == "" {
|
if clusterName == "" {
|
||||||
return fmt.Errorf("clusterName is required")
|
return fmt.Errorf("clusterName is required")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue