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

Fixed concurrency bug when etcd-druid runs more than one worker #28

Merged
merged 1 commit into from
Mar 20, 2020

Conversation

georgekuruvillak
Copy link

@georgekuruvillak georgekuruvillak commented Mar 20, 2020

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:

Fixed the issue related to concurrent reconcilation of etcd resources messing up configmap, service and statefulset values.

@georgekuruvillak georgekuruvillak requested a review from a team as a code owner March 20, 2020 12:00
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Mar 20, 2020
Copy link
Collaborator

@amshuman-kr amshuman-kr left a 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 Show resolved Hide resolved
controllers/etcd_controller.go Outdated Show resolved Hide resolved
controllers/etcd_controller.go Outdated Show resolved Hide resolved
controllers/etcd_controller.go Outdated Show resolved Hide resolved
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)
Copy link
Collaborator

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?

Copy link
Author

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.

controllers/etcd_controller.go Outdated Show resolved Hide resolved
controllers/etcd_controller.go Outdated Show resolved Hide resolved
controllers/etcd_controller.go Outdated Show resolved Hide resolved
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 20, 2020
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 20, 2020
Copy link

@swapnilgm swapnilgm left a comment

Choose a reason for hiding this comment

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

LGTM

return nil, err
}
values["configMapName"] = cm.Name

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.

@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 20, 2020
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 20, 2020
@georgekuruvillak georgekuruvillak merged commit ce5fc71 into gardener:master Mar 20, 2020
@georgekuruvillak georgekuruvillak deleted the hotfix-v0.1.6 branch March 22, 2020 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants