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

fix: allow publicIP to be referenced using selectors and Ref #652

Conversation

migueladh
Copy link
Contributor

Description of your changes

  • Add Reference Extractor for PublicIPAddressId in NetworkInterface, allowing the usage on dynamic objects
  • Add example yaml

Fixes #78

I have:

  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

  1. Run provider locally with the changes
  2. Create the objects provided in the example file
  3. Network interface will be correctly created with publicAddess
kubectl get networkinterface.network.azure.upbound.io/example -o yaml
apiVersion: network.azure.upbound.io/v1beta1
kind: NetworkInterface
metadata:
  annotations:
    crossplane.io/external-create-pending: "2024-02-15T11:51:47+01:00"
    crossplane.io/external-create-succeeded: "2024-02-15T11:51:47+01:00"
    crossplane.io/external-name: example
  creationTimestamp: "2024-02-15T10:49:34Z"
  finalizers:
  - finalizer.managedresource.crossplane.io
  generation: 3
  labels:
    testing.upbound.io/example-name: example
  name: example
  [...]
spec:
  deletionPolicy: Delete
  forProvider:
    ipConfiguration:
    - name: internal
      privateIpAddressAllocation: Dynamic
      publicIpAddressId: /subscriptions/XXXX/resourceGroups/XXXX/providers/Microsoft.Network/publicIPAddresses/example
      publicIpAddressIdRef:
        name: example
      publicIpAddressIdSelector:
        matchLabels:
          testing.upbound.io/example-name: example-public-ip
[...]

Signed-off-by: Miguel Angel Ducanto Hadad <migueladh@ext.inditex.com>
@Upbound-CLA
Copy link

Upbound-CLA commented Feb 15, 2024

CLA assistant check
All committers have signed the CLA.

@jeanduplessis
Copy link
Collaborator

/test-examples="examples/network/networkinterface-publicip.yaml"

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @migueladh, left a few comments for you to consider.

config/network/config.go Outdated Show resolved Hide resolved
examples/network/networkinterface-publicip.yaml Outdated Show resolved Hide resolved
examples/network/networkinterface-publicip.yaml Outdated Show resolved Hide resolved
Signed-off-by: Miguel Angel Ducanto Hadad <migueladh@ext.inditex.com>
Signed-off-by: Miguel Angel Ducanto Hadad <migueladh@ext.inditex.com>
@turkenf
Copy link
Collaborator

turkenf commented Feb 16, 2024

/test-examples="examples/network/networkinterface-publicip.yaml"

@turkenf
Copy link
Collaborator

turkenf commented Feb 16, 2024

@migueladh, I left two more small comments and please sign license/cla for moving forward.

Signed-off-by: Miguel Angel Ducanto Hadad <migueladh@ext.inditex.com>
@migueladh
Copy link
Contributor Author

@turkenf sorry for the delay, all done :)

@turkenf
Copy link
Collaborator

turkenf commented Feb 21, 2024

/test-examples="examples/network/networkinterface-publicip.yaml"

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Thank you for your work in this PR @migueladh, LGTM.

@turkenf turkenf merged commit 910f69b into crossplane-contrib:main Feb 21, 2024
10 checks passed
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.

Network Interface with Public IP fails with cannot reference the public IP
4 participants