Skip to content

Commit

Permalink
Fix DeepValidate calls
Browse files Browse the repository at this point in the history
still needing to either pass an AWSCloud in or conditionally validate if the parameter is nil
  • Loading branch information
rifelpet committed May 28, 2020
1 parent 6b9a074 commit f4867a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
}

strict := false
err = validation.DeepValidate(cluster, instanceGroups, strict)
err = validation.DeepValidate(cluster, instanceGroups, strict, nil)
if err != nil {
return err
}
Expand All @@ -1317,7 +1317,7 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
fullInstanceGroups = append(fullInstanceGroups, fullGroup)
}

err = validation.DeepValidate(fullCluster, fullInstanceGroups, true)
err = validation.DeepValidate(fullCluster, fullInstanceGroups, true, nil)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/kops/edit_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func RunEditCluster(ctx context.Context, f *util.Factory, cmd *cobra.Command, ar
continue
}

err = validation.DeepValidate(fullCluster, instanceGroups, true)
err = validation.DeepValidate(fullCluster, instanceGroups, true, nil)
if err != nil {
results = editResults{
file: file,
Expand Down
4 changes: 2 additions & 2 deletions upup/pkg/fi/cloudup/deepvalidate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestDeepValidate_OK(t *testing.T) {
var groups []*kopsapi.InstanceGroup
groups = append(groups, buildMinimalMasterInstanceGroup("subnet-us-mock-1a"))
groups = append(groups, buildMinimalNodeInstanceGroup("subnet-us-mock-1a"))
err := validation.DeepValidate(c, groups, true)
err := validation.DeepValidate(c, groups, true, nil)
if err != nil {
t.Fatalf("Expected no error from DeepValidate, got %v", err)
}
Expand Down Expand Up @@ -172,7 +172,7 @@ func TestDeepValidate_MissingEtcdMember(t *testing.T) {
}

func expectErrorFromDeepValidate(t *testing.T, c *kopsapi.Cluster, groups []*kopsapi.InstanceGroup, message string) {
err := validation.DeepValidate(c, groups, true)
err := validation.DeepValidate(c, groups, true, nil)
if err == nil {
t.Fatalf("Expected error %q from DeepValidate (strict=true), not no error raised", message)
}
Expand Down

0 comments on commit f4867a9

Please sign in to comment.