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

Fix nats-server-config-reloader for k8s secrets #131

Merged
merged 2 commits into from
Jul 7, 2023
Merged

Conversation

jkralik
Copy link
Contributor

@jkralik jkralik commented Jun 9, 2023

Fixes #130

To fix this issue, the commit ensures that when a file is deleted, the Inotify watches immediately unregister it and then attempt to periodically re-register the file every second until the operation succeeds. This guarantees that the file will continue to be monitored reliably even after deletion.

@wallyqs
Copy link
Member

wallyqs commented Jun 9, 2023

Thanks so much for the report and the fix!! 🙏 I will make a release with this change next week.

Fixes nats-io#130

To fix this issue, the commit ensures that when a file is deleted,
the Inotify watches immediately unregister it and then attempt to
periodically re-register the file every second until the operation
succeeds. This guarantees that the file will continue to be
monitored reliably even after deletion.
jkralik added a commit to plgd-dev/hub that referenced this pull request Jun 13, 2023
* services: reload certificates when it is changed

Hub stopped working because of expired mTLS certificates, even
though the certs were correctly auto-rotated in the k8s cluster.

* charts: set cert-manager.io/private-key-rotation-policy to ingress

* charts: rotate mongo certificates when it has been changed

* nats-server-config-reloader: expose plgd image until fix accepted

nats-io/nack#131
Copy link
Contributor

@piotrpio piotrpio left a comment

Choose a reason for hiding this comment

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

Thanks for this! Looks great save for few nits.

pkg/natsreloader/natsreloader.go Outdated Show resolved Hide resolved
pkg/natsreloader/natsreloader.go Outdated Show resolved Hide resolved
pkg/natsreloader/natsreloader.go Outdated Show resolved Hide resolved
Co-authored-by: Piotr Piotrowski <piotrpiotrowski94@gmail.com>
@jkralik
Copy link
Contributor Author

jkralik commented Jun 28, 2023

Thanks for this! Looks great save for few nits.

Sure. We utilize golangci-lint and have specifically enabled the errcheck feature. (for defer)

@wallyqs wallyqs merged commit 0eb9971 into nats-io:main Jul 7, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nats-server-config-reloader: Inotify Not Working in K8 with the secrets
3 participants