-
Notifications
You must be signed in to change notification settings - Fork 128
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: correct diffs when comparing objects with empty tags #985
Conversation
Right now, when some declarative configuration having empty tags on any of its entities is deployed, subsequent `diff` / `sync` will show misleading results: ``` $ cat kong.yaml _format_version: "3.0" services: - name: foo protocol: http host: foo port: 8000 tags: [] $ deck sync creating service foo Summary: Created: 1 Updated: 0 Deleted: 0 $ deck sync updating service foo { "connect_timeout": 60000, "enabled": true, "host": "foo", "id": "afadd2ed-2bcd-49fc-9000-adb58cd11b50", "name": "foo", "port": 8000, "protocol": "http", "read_timeout": 60000, "retries": 5, "write_timeout": 60000 } Summary: Created: 0 Updated: 1 Deleted: 0 ``` The second `deck sync` run is showing an update without an actual diff. This is due to the way empty tags are treated internally in decK. This commit fixes this defect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a change log entry?
done |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #985 +/- ##
==========================================
+ Coverage 33.71% 34.06% +0.34%
==========================================
Files 100 100
Lines 12006 12106 +100
==========================================
+ Hits 4048 4124 +76
- Misses 7564 7588 +24
Partials 394 394
☔ View full report in Codecov by Sentry. |
Right now, when some declarative configuration having empty tags on any of its entities is deployed, subsequent `diff` / `sync` will show misleading results: ``` $ cat kong.yaml _format_version: "3.0" services: - name: foo protocol: http host: foo port: 8000 tags: [] $ deck sync creating service foo Summary: Created: 1 Updated: 0 Deleted: 0 $ deck sync updating service foo { "connect_timeout": 60000, "enabled": true, "host": "foo", "id": "afadd2ed-2bcd-49fc-9000-adb58cd11b50", "name": "foo", "port": 8000, "protocol": "http", "read_timeout": 60000, "retries": 5, "write_timeout": 60000 } Summary: Created: 0 Updated: 1 Deleted: 0 ``` The second `deck sync` run is showing an update without an actual diff. This is due to the way empty tags are treated internally in decK. This commit fixes this defect.
Right now, when some declarative configuration having empty tags on any of its entities is deployed, subsequent
diff
/sync
will show misleading results:The second
deck sync
run is showing an update without an actual diff. This is due to the way empty tags are treated internally in decK.This commit fixes this defect.