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

structs: fix test for empty DNS configuration #20233

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

tgross
Copy link
Member

@tgross tgross commented Mar 27, 2024

The DNSConfig.IsZero method incorrectly returns true if any of the fields are empty, rather than if all of them are empty.

The only code path that consumes this method is on the client, where it's used as part of equality checks on the allocation network status to set the priority of allocation updates to the server. Hypothetically, if the network hook modified only the DNS configuration and no task states were emitted, it would be possible to miss an allocation update. In practice this appears to be impossible, but we should fix the bug so that there aren't errors in future consumers.


  • Backported only to 1.6.x and 1.7.x because this code doesn't exist in 1.5.x.
  • I don't have a changelog here because this isn't user-visible as far as I can tell

The `DNSConfig.IsZero` method incorrectly returns true if any of the fields are
empty, rather than if all of them are empty.

The only code path that consumes this method is on the client, where it's used
as part of equality checks on the allocation network status to set the priority
of allocation updates to the server. Hypothetically, if the network hook
modified only the DNS configuration and no task states were emitted, it would be
possible to miss an allocation update. In practice this appears to be
impossible, but we should fix the bug so that there aren't errors in future
consumers.
@tgross tgross added type/bug backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line labels Mar 27, 2024
@tgross tgross added this to the 1.7.x milestone Mar 27, 2024
@tgross tgross marked this pull request as ready for review March 27, 2024 15:00
Copy link
Member

@gulducat gulducat left a comment

Choose a reason for hiding this comment

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

zero

@tgross tgross merged commit 31f53ce into main Mar 29, 2024
25 checks passed
@tgross tgross deleted the b-dns-config-diff branch March 29, 2024 14:47
philrenaud pushed a commit that referenced this pull request Apr 18, 2024
The `DNSConfig.IsZero` method incorrectly returns true if any of the fields are
empty, rather than if all of them are empty.

The only code path that consumes this method is on the client, where it's used
as part of equality checks on the allocation network status to set the priority
of allocation updates to the server. Hypothetically, if the network hook
modified only the DNS configuration and no task states were emitted, it would be
possible to miss an allocation update. In practice this appears to be
impossible, but we should fix the bug so that there aren't errors in future
consumers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants