set_cluster: Remove unused instanceGroup parameter from setClusterFields

This commit is contained in:
Bharath Vedartham 2021-01-30 14:31:49 +05:30
parent b50ec1df46
commit 515fbf1c1c
3 changed files with 6 additions and 8 deletions

View File

@ -504,7 +504,7 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
cluster.Spec.MasterPublicName = c.MasterPublicName
}
if err := commands.SetClusterFields(c.Overrides, cluster, instanceGroups); err != nil {
if err := commands.SetClusterFields(c.Overrides, cluster); err != nil {
return err
}

View File

@ -61,7 +61,7 @@ func RunSetCluster(ctx context.Context, f *util.Factory, cmd *cobra.Command, out
return err
}
if err := SetClusterFields(options.Fields, cluster, instanceGroups); err != nil {
if err := SetClusterFields(options.Fields, cluster); err != nil {
return err
}
@ -73,7 +73,7 @@ func RunSetCluster(ctx context.Context, f *util.Factory, cmd *cobra.Command, out
}
// SetClusterFields sets field values in the cluster
func SetClusterFields(fields []string, cluster *api.Cluster, instanceGroups []*api.InstanceGroup) error {
func SetClusterFields(fields []string, cluster *api.Cluster) error {
for _, field := range fields {
kv := strings.SplitN(field, "=", 2)
if len(kv) != 2 {

View File

@ -29,7 +29,7 @@ func TestSetClusterBadInput(t *testing.T) {
"bad-set-input",
}
err := SetClusterFields(fields, &kops.Cluster{}, []*kops.InstanceGroup{})
err := SetClusterFields(fields, &kops.Cluster{})
if err == nil {
t.Errorf("expected a field parsing error, but received none")
}
@ -310,10 +310,9 @@ func TestSetClusterFields(t *testing.T) {
}
for _, g := range grid {
var igs []*kops.InstanceGroup
c := g.Input
err := SetClusterFields(g.Fields, &c, igs)
err := SetClusterFields(g.Fields, &c)
if err != nil {
t.Errorf("unexpected error from setClusterFields %v: %v", g.Fields, err)
continue
@ -362,10 +361,9 @@ func TestSetCiliumFields(t *testing.T) {
}
for _, g := range grid {
var igs []*kops.InstanceGroup
c := g.Input
err := SetClusterFields(g.Fields, &c, igs)
err := SetClusterFields(g.Fields, &c)
if err != nil {
t.Errorf("unexpected error from setClusterFields %v: %v", g.Fields, err)
continue