-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fixed concurrency bug when etcd-druid runs more than one worker #28
Fixed concurrency bug when etcd-druid runs more than one worker #28
Conversation
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.
A couple of suggestions, Can you please address them?
controllers/etcd_controller.go
Outdated
var err error | ||
decoded := &corev1.ConfigMap{} | ||
configMapPath := getChartPathForConfigMap() | ||
if _, ok := r.RenderedChart.Files()[configMapPath]; !ok { | ||
chartPath := getChartPath() | ||
renderedChart, err := r.ChartApplier.Render(chartPath, etcd.Name, etcd.Namespace, *values) |
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 render again and again? Why not do it once and pass it as a parameter to the func?
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.
We have to refactor extensively again. I shall optimise this in that cycle.
9fc8e6d
to
a024d72
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.
LGTM
controllers/etcd_controller.go
Outdated
return nil, err | ||
} | ||
values["configMapName"] = cm.Name |
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.
Similar line should have been there for statefulset like values["name"] = ss.Name. But considering gardener that won't be case. And this is backward compatibility code. So, the change is optional.
a024d72
to
d727a2d
Compare
What this PR does / why we need it:
This PR fixes the issue related to concurrent reconcilation of etcd resources messing up configmap, service and statefulset values.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: