-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Dynamic watch of numaflow controller def configmap by label #67
Conversation
Signed-off-by: chandankumar4 <[email protected]>
Signed-off-by: chandankumar4 <[email protected]>
247c4b6
to
7a41674
Compare
Signed-off-by: chandankumar4 <[email protected]>
Signed-off-by: chandankumar4 <[email protected]>
config/install.yaml
Outdated
labels: | ||
config: numaflow-controller-rollout |
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.
Open for suggestion about defining the label here which will be used while lookup for controller config, this label should not be used for configmap other than controller definition.
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.
suggested in the other comment.
db7d1f8
to
4204757
Compare
Signed-off-by: chandankumar4 <[email protected]>
4204757
to
a61cdfd
Compare
Signed-off-by: chandankumar4 <[email protected]>
399bd1f
to
f23d141
Compare
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.
Can you create an issue to track adding a unit test for dynamic loading new controller definition with new config map? Thanks!
labelKey = "config" | ||
labelValue = "numaflow-controller-rollout" |
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.
Can you move this to common.go
? Also suggested labelKey is numaplane.numaproj.io/config
and labelValue is numaflow-controller-definitions
.
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.
okay
config/install.yaml
Outdated
labels: | ||
config: numaflow-controller-rollout |
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.
suggested in the other comment.
return nil | ||
} | ||
|
||
// watchConfigMaps watches for configmaps continuously and writes the data to the given directory based on an event type. |
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.
nit: writes the data to the given directory
is no longer accurate.
// watchConfigMaps watches for configmaps continuously and writes the data to the given directory based on an event type. | ||
func watchConfigMaps(ctx context.Context, client kubernetes.Interface, namespace string) { | ||
numaLogger := logger.FromContext(ctx) | ||
watcher, err := client.CoreV1().ConfigMaps(namespace).Watch(ctx, metav1.ListOptions{}) |
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.
Why can't we watch with a label selector to filter?
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.
Ohh, I checked the ListOptions{} struct it has the way to pass label, let me make the change. Thanks
Signed-off-by: chandankumar4 <[email protected]>
846ef09
to
d8b27ab
Compare
Signed-off-by: chandankumar4 <[email protected]>
Sure, #69 |
Signed-off-by: chandankumar4 <[email protected]> Signed-off-by: dsimha <[email protected]>
Fixes #13
Modifications
More detail approach:
Verification