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

UID filter for DNS record API query returns no records #1430

Closed
speedst3r opened this issue Jan 11, 2025 · 3 comments
Closed

UID filter for DNS record API query returns no records #1430

speedst3r opened this issue Jan 11, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@speedst3r
Copy link

speedst3r commented Jan 11, 2025

Describe the bug
The change made in #1429 to add filtering does not appear to be working correctly. When supplying the UID on the query the API returns no records, when there should be valid records.

To Reproduce
Steps to reproduce the behavior:

  1. Create records in a DNS zone.
  2. Query records filtering by hostname and type (records returned).
  3. Query records filtering by hostname, type and UID (no records returned)

Expected behavior
UID filter returns correct records

Screenshots
Return all records for a hostname

$ curl -s -H "Authorization: Bearer <token>" "https://gravity.example.com/api/v1/dns/zones/records?zone=example.com.&hostname=@&type=A" | jq
{
  "records": [
    {
      "uid": "0",
      "fqdn": "@.example.com.",
      "hostname": "@",
      "type": "A",
      "data": "192.168.0.238"
    },
    {
      "uid": "1",
      "fqdn": "@.example.com.",
      "hostname": "@",
      "type": "A",
      "data": "192.168.0.245"
    }
  ]
}

UID filter fails to return records:

$ curl -s -H "Authorization: Bearer <token>" "https://gravity.example.com/api/v1/dns/zones/records?zone=example.com.&hostname=@&type=A&uid=0" | jq
{
  "records": null
}

$ curl -s -H "Authorization: Bearer <token> "https://gravity.example.com/api/v1/dns/zones/records?zone=example.com.&hostname=@&type=A&uid=1" | jq
{
  "records": null
}

Logs
Output of docker-compose logs or kubectl logs respectively

2025-01-11 08:53:52.370	{"level":"info","ts":1736556832.3699117,"logger":"role.api","msg":"/api/v1/dns/zones/records?zone=example.com.&hostname=@&type=A","instance":"gravity-1","version":"0.22.0","host":"gravity.example.com","remote":"10.1.183.247:33308","runtime":25,"method":"GET","size":186,"status":200,"userAgent":"curl/8.5.0","user":"admin"}
2025-01-11 08:53:53.932	{"level":"info","ts":1736556833.932766,"logger":"role.api","msg":"/api/v1/dns/zones/records?zone=example.com.&hostname=@&type=A&uid=0","instance":"gravity-2","version":"0.22.0","host":"gravity.example.com","remote":"10.1.183.247:36654","runtime":27,"method":"GET","size":17,"status":200,"userAgent":"curl/8.5.0","user":"admin"}
2025-01-11 08:56:28.733	{"level":"info","ts":1736556988.7338195,"logger":"role.api","msg":"/api/v1/dns/zones/records?zone=example.com.&hostname=@&type=A&uid=1","instance":"gravity-1","version":"0.22.0","host":"gravity.example.com","remote":"10.1.183.247:56060","runtime":24,"method":"GET","size":17,"status":200,"userAgent":"curl/8.5.0","user":"admin"}

Version and Deployment (please complete the following information):

  • Gravity version: 0.22.0
  • Deployment: kubernetes statefulset (3 replicas); external etcd (aenix)

Additional context
Queries directly against individual gravity pods exhibit same behaviour.
This also impacts state management for the Terraform provider.

@speedst3r speedst3r added the bug Something isn't working label Jan 11, 2025
@BeryJu
Copy link
Owner

BeryJu commented Jan 11, 2025

this should be fixed by 3228525 included in the newest :latest image

@speedst3r
Copy link
Author

Just tested :latest and indeed it is. Apologies :)

@BeryJu
Copy link
Owner

BeryJu commented Jan 16, 2025

This has been released with v0.23

@BeryJu BeryJu closed this as completed Jan 16, 2025
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

No branches or pull requests

2 participants