mirror of https://github.com/kubernetes/kops.git
Merge pull request #1176 from DualSpark/bastion-lc-delete-fix
Fixing abandoned launch configurations in kops
This commit is contained in:
commit
362e2cb33e
|
@ -119,6 +119,8 @@ func (c *DeleteCluster) ListResources() (map[string]*ResourceTracker, error) {
|
|||
// ASG
|
||||
ListAutoScalingGroups,
|
||||
ListAutoScalingLaunchConfigurations,
|
||||
// LC
|
||||
|
||||
// Route 53
|
||||
ListRoute53Records,
|
||||
// IAM
|
||||
|
@ -1336,9 +1338,12 @@ func ListAutoScalingLaunchConfigurations(cloud fi.Cloud, clusterName string) ([]
|
|||
continue
|
||||
}
|
||||
|
||||
glog.V(8).Infof("UserData: %s", string(userData))
|
||||
//I finally found what was polluting logs with the bash scripts.
|
||||
//glog.V(8).Infof("UserData: %s", string(userData))
|
||||
|
||||
if extractClusterName(userData) == clusterName {
|
||||
// Adding in strings.Contains() here on cluster name, making the grand assumption that if our clustername string is present
|
||||
// in the name of the LC, it's safe to delete. This solves the bastion LC problem.
|
||||
if extractClusterName(userData) == clusterName || strings.Contains(*t.LaunchConfigurationName, clusterName) {
|
||||
tracker := &ResourceTracker{
|
||||
Name: aws.StringValue(t.LaunchConfigurationName),
|
||||
ID: aws.StringValue(t.LaunchConfigurationName),
|
||||
|
|
Loading…
Reference in New Issue