Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused instanceGroup parameter from setClusterFields #10690

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/set_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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 {
Expand Down
8 changes: 3 additions & 5 deletions pkg/commands/set_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down