mirror of https://github.com/kubernetes/kops.git
SecurityGroupRule: Avoid spurious warnings when SourceGroup not found
We were warning on a Find operation, which just isn't right - we can just skip the find.
This commit is contained in:
parent
b419f2013d
commit
67d80bcecb
|
|
@ -336,6 +336,12 @@ func (e *SecurityGroup) FindDeletions(c *fi.Context) ([]fi.Deletion, error) {
|
|||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
if er.SourceGroup != nil && er.SourceGroup.ID == nil {
|
||||
glog.V(4).Infof("Deletion skipping find of SecurityGroupRule %s, because SourceGroup was not found", fi.StringValue(er.Name))
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if er.matches(permission) {
|
||||
found = true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@ func (e *SecurityGroupRule) Find(c *fi.Context) (*SecurityGroupRule, error) {
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
if e.SourceGroup != nil && e.SourceGroup.ID == nil {
|
||||
glog.V(4).Infof("Skipping find of SecurityGroupRule %s, because SourceGroup was not found", fi.StringValue(e.Name))
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
request := &ec2.DescribeSecurityGroupsInput{
|
||||
Filters: []*ec2.Filter{
|
||||
awsup.NewEC2Filter("group-id", *e.SecurityGroup.ID),
|
||||
|
|
|
|||
Loading…
Reference in New Issue