-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[common-go] Add file watcher #10020
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
[common-go] Add file watcher #10020
Conversation
ffcfa78
to
5de52b5
Compare
/werft run 👍 started the job as gitpod-build-aledbf-watcher.14 |
bac375b
to
4fdbccd
Compare
I love this feature. Do you have a plan to apply it to other components (e.g. ws-manager)? |
Not really. The only two components that support partial configuration reload are ws-daemon and ws-registry. That said, if we add such a feature to any other component, like ws-manager, we can add the four lines required to detect changes. |
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.
works fine
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.
https://github.com/spf13/viper looks to solve this problem, perhaps we could simplify our usage with it.
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.
Change makes a ton of sense.
Left two comments.
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.
Having a Kubernetes controller and watches the ConfigMap change (resourceVersion change) is also a way.
That means we need to watch the configmap using client-go. I would prefer to not add that here. |
Almost the same code https://github.com/spf13/viper/blob/v1.11.0/viper.go#L440 I am ok to use that but right now we are not using |
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.
LGTM. Left a couple of comments but those do not block this PR and can be done as follow-up. Adding hold in case you want to tackle them in this PR (approvals will persist after a commit).
/hold
Fix lint errors
/werft run 👍 started the job as gitpod-build-aledbf-watcher.21 |
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.
/lgtm
/unhold |
Description
Refactor watch of configuration files and reload and remove duplication
How to test
ws-daemon
orws-daemon
configmap and check the reload message appears in the logRelease Notes