Skip to content

Fix AWS Security Group leakage at creation when an error occures #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ack_generate_info:
build_date: "2024-01-15T16:33:37Z"
build_hash: 3753ca3f6610172e9e652d6e5e62e0a05f2e639c
go_version: go1.21.5
version: v0.28.0-11-g3753ca3
build_date: "2024-01-18T10:01:49Z"
build_hash: 7fd3f40fa2160580297ee82914ccdde32312312b
go_version: go1.21.6
version: v0.28.0-17-g7fd3f40
api_directory_checksum: 8b27f9e65dbad1f5f825c84d1dbe8fd333baf2a5
api_version: v1alpha1
aws_sdk_go_version: v1.44.93
Expand Down
4 changes: 2 additions & 2 deletions helm/crds/services.k8s.aws_adoptedresources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ spec:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names'
type: string
uid:
description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids'
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids'
type: string
required:
- apiVersion
Expand Down
15 changes: 0 additions & 15 deletions helm/templates/role-writer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,20 @@ rules:
- ec2.services.k8s.aws
resources:
- dhcpoptions

- elasticipaddresses

- flowlogs

- instances

- internetgateways

- natgateways

- networkacls

- routetables

- securitygroups

- subnets

- transitgateways

- vpcs

- vpcendpoints

- vpcendpointserviceconfigurations

- vpcpeeringconnections

verbs:
- create
- delete
Expand Down
6 changes: 3 additions & 3 deletions pkg/resource/security_group/sdk.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

// Delete the default egress rule
if err = rm.deleteDefaultSecurityGroupRule(ctx, &resource{ko}); err != nil {
return nil, err
return &resource{ko}, err
}

if err = rm.syncSGRules(ctx, &resource{ko}, nil); err != nil {
return nil, err
return &resource{ko}, err
}

// A ReadOne call for SecurityGroup Rules (NOT SecurityGroups)
// is made to refresh Status.Rules with the recently-updated
// data from the above `sync` call
if rules, err := rm.getRules(ctx, &resource{ko}); err != nil {
return nil, err
return &resource{ko}, err
Comment on lines -8 to +19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

} else {
ko.Status.Rules = rules
}