Skip to content

Commit

Permalink
Use ec2.DescribeInstanceTypes for machine type info
Browse files Browse the repository at this point in the history
  • Loading branch information
rifelpet committed May 29, 2020
1 parent e3fc840 commit 7d0c704
Show file tree
Hide file tree
Showing 24 changed files with 164 additions and 2,908 deletions.
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -821,13 +821,6 @@ build-docs-netlify:
pip install -r ${KOPS_ROOT}/images/mkdocs/requirements.txt
mkdocs build

# Update machine_types.go
.PHONY: update-machine-types
update-machine-types:
go build -o hack/machine_types/machine_types ${KOPS_ROOT}/hack/machine_types/
hack/machine_types/machine_types --out upup/pkg/fi/cloudup/awsup/machine_types.go
go fmt upup/pkg/fi/cloudup/awsup/machine_types.go

#-----------------------------------------------------------
# development targets

Expand Down
5 changes: 5 additions & 0 deletions cloudmock/aws/mockec2/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ func (m *MockEC2) DescribeInstancesPages(request *ec2.DescribeInstancesInput, ca
func (m *MockEC2) DescribeInstancesPagesWithContext(aws.Context, *ec2.DescribeInstancesInput, func(*ec2.DescribeInstancesOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
}

func (m *MockEC2) DescribeInstanceTypes(*ec2.DescribeInstanceTypesInput) (*ec2.DescribeInstanceTypesOutput, error) {
klog.Warningf("MockEc2::DescribeInstanceTypes is stub-implemented")
return &ec2.DescribeInstanceTypesOutput{}, nil
}
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
1 change: 0 additions & 1 deletion hack/.packages
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ k8s.io/kops/dnsprovider/pkg/dnsprovider/providers/openstack/designate
k8s.io/kops/dnsprovider/pkg/dnsprovider/rrstype
k8s.io/kops/dnsprovider/pkg/dnsprovider/tests
k8s.io/kops/examples/kops-api-example
k8s.io/kops/hack/machine_types
k8s.io/kops/kube-discovery/cmd/kube-discovery
k8s.io/kops/node-authorizer/cmd/node-authorizer
k8s.io/kops/node-authorizer/pkg/authorizers/alwaysallow
Expand Down
1 change: 0 additions & 1 deletion hack/machine_types/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions hack/machine_types/BUILD.bazel

This file was deleted.

19 changes: 0 additions & 19 deletions hack/machine_types/README.md

This file was deleted.

Loading

0 comments on commit 7d0c704

Please sign in to comment.