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(helm-operator): do not send empty patch requests to kube apiserver #4957

Merged
merged 3 commits into from
Jun 8, 2021

Conversation

chlam4
Copy link
Contributor

@chlam4 chlam4 commented May 28, 2021

Description of the change:
This change is in the helm operator when generating patch requests during each reconcile cycle. The change filters out empty patches generated from the 3-way merge, which could be in the form of the "{}" byte array that represents an empty map. This byte array is neither nil or zero-length, so the release reconciler sees it as non-empty and sends out a patch request to the kube apiserver.

This addresses #4956.

Motivation for the change:
We have a deployment scenario with hundreds of helm operators, each generating ~60 empty patch requests even there are no changes. That caused heavy traffic onto the kube apiserver.

Testing done:

…ut of the 3-way merge.

Signed-off-by: Cheuk Lam <chlam4@hotmail.com>
@jsm84
Copy link

jsm84 commented Jun 1, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 1, 2021
@asmacdo
Copy link
Member

asmacdo commented Jun 7, 2021

looks reasonable to me, allowing the tests to run

Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

@chlam4 thanks for the bugfix. Can you add a changelog fragment? Then I'll approve.

…sts.

Signed-off-by: Cheuk Lam <chlam4@hotmail.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 7, 2021
@chlam4
Copy link
Contributor Author

chlam4 commented Jun 7, 2021

Thanks @jsm84, @asmacdo and @estroz. @estroz, I've created a changelog fragment following one of the examples. Can you please take a look to see if it's ok?

@chlam4 chlam4 requested a review from estroz June 7, 2021 19:21
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 7, 2021
@estroz
Copy link
Member

estroz commented Jun 7, 2021

/cherry-pick v1.8.x
/cherry-pick v1.7.x

@openshift-cherrypick-robot

@estroz: once the present PR merges, I will cherry-pick it on top of v1.8.x in a new PR and assign it to you.

In response to this:

/cherry-pick v1.8.x
/cherry-pick v1.7.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Co-authored-by: Eric Stroczynski <estroczy@redhat.com>
Signed-off-by: Cheuk Lam <chlam4@hotmail.com>
@openshift-ci
Copy link

openshift-ci bot commented Jun 7, 2021

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 7, 2021
@chlam4
Copy link
Contributor Author

chlam4 commented Jun 7, 2021

@estroz I had to force push the last commit to fulfill the DCO sign-off requirement. Do you mind re-authorizing the workflows? Thanks in advance!

@estroz estroz changed the title Filtering out empty patch requests generated from the 3-way merge to avoid unnecessary load on kube apiserver fix(helm-operator): do not send empty patch requests to kube apiserver Jun 8, 2021
@estroz estroz merged commit ec26aad into operator-framework:master Jun 8, 2021
@openshift-cherrypick-robot

@estroz: new pull request created: #4971

In response to this:

/cherry-pick v1.8.x
/cherry-pick v1.7.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-cherrypick-robot

@estroz: new pull request created: #4972

In response to this:

/cherry-pick v1.8.x
/cherry-pick v1.7.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

varshaprasad96 added a commit to varshaprasad96/helm-operator-plugins that referenced this pull request Dec 6, 2021
The change filters out empty patches generated from the 3-way merge,
which could be in the form of the "{}" byte array that
represents an empty map.

Reference: operator-framework/operator-sdk#4957
Co-authored-by: Cheuk Lam
varshaprasad96 added a commit to varshaprasad96/helm-operator-plugins that referenced this pull request Dec 6, 2021
The change filters out empty patches generated from the 3-way merge,
which could be in the form of the "{}" byte array that
represents an empty map.

Reference: operator-framework/operator-sdk#4957
Co-authored-by: Cheuk Lam
varshaprasad96 added a commit to operator-framework/helm-operator-plugins that referenced this pull request Dec 7, 2021
#139)

The change filters out empty patches generated from the 3-way merge,
which could be in the form of the "{}" byte array that
represents an empty map.

Reference: operator-framework/operator-sdk#4957
Co-authored-by: Cheuk Lam
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.

5 participants