Skip to content

Commit

Permalink
deprecate --service eks
Browse files Browse the repository at this point in the history
  • Loading branch information
bwagner5 committed Mar 16, 2023
1 parent 60da7b3 commit 6fea75f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 269 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ $ ec2-instance-selector --help
```

```bash#help
ec2-instance-selector is a CLI tool to filter EC2 instance types based on resource criteria.
ec2-instance-selector is a CLI tool to filter EC2 instance types based on resource criteria.
Filtering allows you to select all the instance types that match your application requirements.
Full docs can be found at github.com/aws/amazon-ec2-instance-selector
Expand Down Expand Up @@ -378,7 +378,7 @@ Filter Flags:
Suite Flags:
--base-instance-type string Instance Type used to retrieve similarly spec'd instance types
--flexible Retrieves a group of instance types spanning multiple generations based on opinionated defaults and user overridden resource filters
--service string Filter instance types based on service support (Example: eks, eks-20201211, or emr-5.20.0)
--service string Filter instance types based on service support (Example: emr-5.20.0)
Global Flags:
Expand Down
6 changes: 5 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Full docs can be found at github.com/aws/amazon-` + binName

cli.SuiteStringFlag(instanceTypeBase, nil, nil, "Instance Type used to retrieve similarly spec'd instance types", nil)
cli.SuiteBoolFlag(flexible, nil, nil, "Retrieves a group of instance types spanning multiple generations based on opinionated defaults and user overridden resource filters")
cli.SuiteStringFlag(service, nil, nil, "Filter instance types based on service support (Example: eks, eks-20201211, or emr-5.20.0)", nil)
cli.SuiteStringFlag(service, nil, nil, "Filter instance types based on service support (Example: emr-5.20.0)", nil)

// Configuration Flags - These will be grouped at the bottom of the help flags

Expand Down Expand Up @@ -242,6 +242,10 @@ Full docs can be found at github.com/aws/amazon-` + binName
os.Exit(0)
}

if flags[service] != nil {
log.Println("--service eks is deprecated. EKS generally supports all instance types")
}

sess, err := getRegionAndProfileAWSSession(cli.StringMe(flags[region]), cli.StringMe(flags[profile]))
if err != nil {
fmt.Println(err)
Expand Down
134 changes: 0 additions & 134 deletions pkg/selector/eks.go

This file was deleted.

130 changes: 0 additions & 130 deletions pkg/selector/eks_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions pkg/selector/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ func (sr *ServiceRegistry) Register(name string, service Service) {

// RegisterAWSServices registers the built-in AWS service filter transforms
func (sr *ServiceRegistry) RegisterAWSServices() {
sr.Register("eks", &EKS{})
sr.Register("emr", &EMR{})
}

// ExecuteTransforms will execute the ServiceRegistry's registered service filter transforms
// Filters.Service will be parsed as <service-name>-<version> and passed to Service.Filters
func (sr *ServiceRegistry) ExecuteTransforms(filters Filters) (Filters, error) {
if filters.Service == nil || *filters.Service == "" {
if filters.Service == nil || *filters.Service == "" || *filters.Service == "eks" {
return filters, nil
}
serviceAndVersion := strings.ToLower(*filters.Service)
Expand Down

0 comments on commit 6fea75f

Please sign in to comment.