Skip to content

Commit

Permalink
pkg/destroy/aws: Remove ClusterName consumer
Browse files Browse the repository at this point in the history
We used to use this for AWS teardown, but e24c7dc (pkg/destroy/aws:
Use the resource-groups service for tag->ARN lookup, 2019-01-10,
cluster name for deletion.  Personally, I'd like to drop this from the
cluster metadata entirely (and move it into libvirt-specific
metadata), but Abhinav is concerned about other metadata.json uses
[1], so I'm punting on that for now.

[1]: #1170 (comment)
  • Loading branch information
wking committed Feb 1, 2019
1 parent 4cea5ca commit 9ad20c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
7 changes: 3 additions & 4 deletions pkg/destroy/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ func NewAWS(logger logrus.FieldLogger, metadata *types.ClusterMetadata) (Destroy
}

return &aws.ClusterUninstaller{
Filters: filters,
Region: metadata.ClusterPlatformMetadata.AWS.Region,
ClusterName: metadata.ClusterName,
Logger: logger,
Filters: filters,
Region: metadata.ClusterPlatformMetadata.AWS.Region,
Logger: logger,
}, nil
}

Expand Down
10 changes: 3 additions & 7 deletions pkg/destroy/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,15 @@ type ClusterUninstaller struct {
// }
//
// will match resources with (a:b and c:d) or d:e.
Filters []Filter // filter(s) we will be searching for
Logger logrus.FieldLogger
Region string
ClusterName string
Filters []Filter // filter(s) we will be searching for
Logger logrus.FieldLogger
Region string
}

func (o *ClusterUninstaller) validate() error {
if len(o.Filters) == 0 {
return errors.Errorf("you must specify at least one tag filter")
}
if len(o.ClusterName) == 0 {
return errors.Errorf("you must specify cluster-name")
}
return nil
}

Expand Down

0 comments on commit 9ad20c3

Please sign in to comment.