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

Improve data-plane pods annotation update logic #999

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented Jun 15, 2021

There could be situations where our reconciler failed to update a pod annotation
in a previous reconcile and since there might be multiple pods running we
want to make sure that all pods have the same annotation.

This patch moves the logic to check that we're not performing an
unnecessary update down to when we're trying to update a single pod
annotation.

Signed-off-by: Pierangelo Di Pilato pierangelodipilato@gmail.com

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 15, 2021
@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 15, 2021
@pierDipi pierDipi force-pushed the update-data-plane=pods-annotation-improvement branch from 5528958 to 21778e7 Compare June 15, 2021 19:35
@codecov
Copy link

codecov bot commented Jun 15, 2021

Codecov Report

Merging #999 (3abcd63) into main (3ec1fab) will decrease coverage by 0.34%.
The diff coverage is 28.20%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #999      +/-   ##
============================================
- Coverage     75.60%   75.25%   -0.35%     
- Complexity      417      420       +3     
============================================
  Files            73       74       +1     
  Lines          2906     2914       +8     
  Branches        124      124              
============================================
- Hits           2197     2193       -4     
- Misses          556      564       +8     
- Partials        153      157       +4     
Flag Coverage Δ
java-unittests 79.43% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
control-plane/pkg/reconciler/broker/broker.go 75.54% <23.80%> (-2.54%) ⬇️
control-plane/pkg/reconciler/base/reconciler.go 72.72% <33.33%> (-3.64%) ⬇️
control-plane/pkg/reconciler/sink/kafka_sink.go 73.94% <33.33%> (-1.48%) ⬇️
...v/knative/eventing/kafka/broker/receiver/Main.java 0.00% <0.00%> (ø)
...kafka/broker/receiver/ReceiverVerticleFactory.java 57.14% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ec1fab...3abcd63. Read the comment docs.

There could be situations where our reconciler failed to update a pod annotation
in a previous reconcile and since there might be multiple pods running we
want to make sure that all pods have the same annotation.

This patch moves the logic to check that we're not performing an
unnecessary update down to when we're trying to update a single pod
annotation.

Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@pierDipi pierDipi force-pushed the update-data-plane=pods-annotation-improvement branch from 21778e7 to b36a40e Compare June 15, 2021 20:06
Copy link
Contributor

@slinkydeveloper slinkydeveloper left a comment

Choose a reason for hiding this comment

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

Minor comment

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-sandbox-eventing-kafka-broker-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
control-plane/pkg/reconciler/base/reconciler.go 80.5% 76.8% -3.7
control-plane/pkg/reconciler/broker/broker.go 87.3% 86.2% -1.1
control-plane/pkg/reconciler/sink/kafka_sink.go 83.5% 82.6% -1.0

@pierDipi
Copy link
Member Author

/retest

@slinkydeveloper
Copy link
Contributor

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 21, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pierDipi, slinkydeveloper

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [pierDipi,slinkydeveloper]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 99ae7d1 into knative-extensions:main Jun 21, 2021
@pierDipi pierDipi deleted the update-data-plane=pods-annotation-improvement branch June 21, 2021 15:19
matzew pushed a commit to matzew/eventing-kafka-broker that referenced this pull request Mar 5, 2024
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
matzew pushed a commit to matzew/eventing-kafka-broker that referenced this pull request Apr 25, 2024
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this pull request Apr 29, 2024
…ions#1065)

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants