Skip to content
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

ec2.SecurityGroup: Observe existing SecurityGroup #1283

Conversation

ONordander
Copy link
Contributor

@ONordander ONordander commented May 3, 2022

This allows transferring ownership of an existing SecurityGroup.

Signed-off-by: Otto Nordander otto.nordander@resurs.se

Description of your changes

Check if a SecurityGroup exists during controller.Observe to allow transferring ownership of SGs.

Fixes #1175

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Tested with local Kind cluster.

apiVersion: ec2.aws.crossplane.io/v1beta1
kind: SecurityGroup
metadata:
  name: test-security-group
spec:
  deletionPolicy: Orphan
  providerConfigRef:
    name: local
  forProvider:
    region: eu-central-1
    groupName: test-security-group
    description: Test security group
    vpcId: <vpc-id>
kubectl apply -f securitygroup.yaml
kubectl get securitygroup test-security-group # ID: sg-<ID>
kubectl delete -f securitygroup.yaml
kubectl get securitygroup # No resources found
kubectl apply -f securitygroup.yaml
kubectl get securitygroup test-security-group # ID: sg-<ID> (same ID as previously)

@ONordander ONordander force-pushed the feature/observe-existing-security-group branch from 1fbb1b3 to 883e44b Compare May 3, 2022 10:24
This allows transferring ownership of an existing SecurityGroup.

Signed-off-by: Otto Nordander <otto.nordander@resurs.se>
@ONordander ONordander force-pushed the feature/observe-existing-security-group branch from 883e44b to e0434a7 Compare May 3, 2022 10:28
@ONordander
Copy link
Contributor Author

Found an open issue #1175.

Copy link
Member

@haarchri haarchri left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for this

@haarchri haarchri merged commit a56c21e into crossplane-contrib:master May 6, 2022
@ONordander ONordander deleted the feature/observe-existing-security-group branch May 6, 2022 06:38
chlunde added a commit to sparebank1utvikling/provider-aws that referenced this pull request May 19, 2022
febarbosa182 pushed a commit to febarbosa182/provider-aws that referenced this pull request May 23, 2022
…#1283)

This allows transferring ownership of an existing SecurityGroup.

Signed-off-by: Otto Nordander <otto.nordander@resurs.se>
Signed-off-by: Felipe Barbosa <lybrbarbosa@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It is not possible to import securitygroup which is created previously by composition with same claim.
2 participants