Kong / go-database-reconciler

Apache License 2.0
5 stars 3 forks source link

fix: correctly compare compressed/expanded ipv6 in targets #109

Closed GGabriele closed 3 months ago

GGabriele commented 3 months ago

When syncing a target with a compressed IPv6 (for example [2001:db8:fd73::e]:1326) decK can successfully create it but it fails to detect its existence when pulling the config from the API because the CP expands the address (for example to [2001:0db8:fd73:0000:0000:0000:0000:000e]:1326) causing decK to attempt to recreate the target and failing because the target already exists.

This commit fixes this by using some helpers to expand the ipv6 before trying to sync/dump.

Summary

SUMMARY_GOES_HERE

Full changelog

Issues resolved

Fix #XXX

Documentation

Testing

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 87.23404% with 6 lines in your changes missing coverage. Please review.

Project coverage is 41.42%. Comparing base (c70e4ec) to head (6764fd2).

Files Patch % Lines
pkg/file/builder.go 87.23% 4 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #109 +/- ## ========================================== + Coverage 41.23% 41.42% +0.19% ========================================== Files 75 75 Lines 10793 10840 +47 ========================================== + Hits 4450 4491 +41 - Misses 5881 5885 +4 - Partials 462 464 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.