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

IP assigned when owner does not exist in Netbox #39

Closed
2 tasks done
faebr opened this issue Sep 5, 2024 · 0 comments · Fixed by #72
Closed
2 tasks done

IP assigned when owner does not exist in Netbox #39

faebr opened this issue Sep 5, 2024 · 0 comments · Fixed by #72
Assignees
Labels
bug Something isn't working

Comments

@faebr
Copy link
Contributor

faebr commented Sep 5, 2024

Bug report criteria

  • This bug report is not security related, security issues should be disclosed privately via netbox operator maintainers.
  • Existing open issues have been checked and this is not a duplicate.

What happened?

When creating an IpAddressClaim with a tenant which does not exist, an ipAddress resource is generated containing the next available IPAddress from the prefix.

What did you expect to happen?

There should be no IPAddress generated at all since the Tenant does not exist.

How can we reproduce it (as minimally and precisely as possible)?

Apply following cr and an ipaddress resource will be generated containing an ip:

apiVersion: netbox.dev/v1
kind: IpAddressClaim
metadata:
  labels:
    app.kubernetes.io/name: netbox-operator
    app.kubernetes.io/managed-by: kustomize
  name: ipaddressclaim-sample-2
spec:
  tenant: "non-existant-tenant"
  description: "some description"
  comments: "your comments"
  preserveInNetbox: true
  parentPrefix: "2.0.0.0/16"

Netbox operator version

Latest from main branch

Netbox operator configuration (command line flags or environment variables)

Followed the instructions from the readme

Relevant log output

IP Addres generated from claim above:

Name:         ipaddressclaim-sample-2
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  netbox.dev/v1
Kind:         IpAddress
Metadata:
  Creation Timestamp:  2024-09-05T13:16:10Z
  Generation:          1
  Owner References:
    API Version:     netbox.dev/v1
    Kind:            IpAddressClaim
    Name:            ipaddressclaim-sample-2
    UID:             c568f9e5-1964-4f31-aab3-170cac459dea
  Resource Version:  5641
  UID:               493a998c-3753-4962-9ee1-932738ad0b91
Spec:
  Comments:  your comments
  Custom Fields:
    Netbox Operator Restoration Hash:  0e12f7d8e25476025adf6e5dba63c8b60f674c80
  Description:                         some description
  Ip Address:                          2.0.0.2/32
  Preserve In Netbox:                  true
  Tenant:                              non-existant-tenant
Status:
  Conditions:
    Last Transition Time:  2024-09-05T13:16:10Z
    Message:               Failed to reserve IP in NetBox. 2.0.0.2/32
    Reason:                FailedToReserveIpInNetbox
    Status:                False
    Type:                  Ready
Events:
  Type     Reason                     Age   From                   Message
  ----     ------                     ----  ----                   -------
  Warning  FailedToReserveIpInNetbox  4m    ip-address-controller  Failed to reserve IP in NetBox. 2.0.0.2/32

Anything else we need to know?

No response

@faebr faebr added the bug Something isn't working label Sep 5, 2024
@netbox-community netbox-community deleted a comment Sep 5, 2024
@MaIT-HgA MaIT-HgA self-assigned this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants