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 selector path for cg scale subresource #3666

Merged

Conversation

Cali0707
Copy link
Member

@Cali0707 Cali0707 commented Feb 2, 2024

Currently, we don't define the scale subresource correctly on the consumergroup, as we say that the labelSelectorPath is .status.selector, while we set .spec.selector instead. See the code here:

if cg.Spec.Selector == nil || len(cg.Spec.Selector) == 0 {
cg.Spec.Selector = cg.Spec.Template.Labels
}

I believe this should fix the "SelectorRequired" warnings we see on the scaled objects reported in knative/eventing#7655

Proposed Changes

  • Set the .status.selector json path with the required values

Release Note

:bug: the scale subresource is now correctly defined for consumergroups

Docs

Signed-off-by: Calum Murray <cmurray@redhat.com>
@knative-prow knative-prow bot added area/control-plane approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 2, 2024
@knative-prow knative-prow bot requested review from creydr and Leo6Leo February 2, 2024 16:07
@Cali0707
Copy link
Member Author

Cali0707 commented Feb 2, 2024

/cherry-pick release-1.13

@knative-prow-robot
Copy link
Contributor

@Cali0707: once the present PR merges, I will cherry-pick it on top of release-1.13 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.13

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.

@Cali0707
Copy link
Member Author

Cali0707 commented Feb 2, 2024

/cherry-pick release-1.12

@knative-prow-robot
Copy link
Contributor

@Cali0707: once the present PR merges, I will cherry-pick it on top of release-1.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.12

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.

@pierDipi
Copy link
Member

pierDipi commented Feb 2, 2024

/cc @converge

Copy link

knative-prow bot commented Feb 2, 2024

@pierDipi: GitHub didn't allow me to request PR reviews from the following users: converge.

Note that only knative-extensions members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @converge

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.

Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6012e1b) 61.94% compared to head (7420dd9) 74.49%.
Report is 8 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #3666       +/-   ##
=============================================
+ Coverage     61.94%   74.49%   +12.54%     
- Complexity      845      846        +1     
=============================================
  Files           188       97       -91     
  Lines         12785     3207     -9578     
  Branches        273      273               
=============================================
- Hits           7920     2389     -5531     
+ Misses         4235      651     -3584     
+ Partials        630      167      -463     
Flag Coverage Δ
java-unittests 74.49% <ø> (+0.09%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Cali0707
Copy link
Member Author

Cali0707 commented Feb 2, 2024

/hold
Looks like I need to debug this change a bit more...

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 2, 2024
Signed-off-by: Calum Murray <cmurray@redhat.com>
@knative-prow knative-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 2, 2024
Signed-off-by: Calum Murray <cmurray@redhat.com>
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 2, 2024
@Cali0707
Copy link
Member Author

Cali0707 commented Feb 2, 2024

/unhold

The CI seems less flaky after the fix (or maybe I got lucky 🤷), maybe the incorrect scale subresource definition was also slowing things down on the API server side @pierDipi

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 2, 2024
@Cali0707
Copy link
Member Author

Cali0707 commented Feb 2, 2024

/test reconciler-tests

2 similar comments
@matzew
Copy link
Contributor

matzew commented Feb 5, 2024

/test reconciler-tests

@pierDipi
Copy link
Member

pierDipi commented Feb 5, 2024

/test reconciler-tests

@Cali0707
Copy link
Member Author

Cali0707 commented Feb 5, 2024

/retest

@converge
Copy link
Member

converge commented Feb 5, 2024

I have manually tested, and it works as expected! 🎉

HPA now shows the kafka lag value / target

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@Cali0707
Copy link
Member Author

Cali0707 commented Feb 6, 2024

/cc @pierDipi

@knative-prow knative-prow bot requested a review from pierDipi February 6, 2024 15:12
@pierDipi
Copy link
Member

pierDipi commented Feb 6, 2024

/test reconciler-tests

@Cali0707
Copy link
Member Author

Cali0707 commented Feb 6, 2024

/retest-required

1 similar comment
@Cali0707
Copy link
Member Author

Cali0707 commented Feb 7, 2024

/retest-required

@creydr
Copy link
Contributor

creydr commented Feb 8, 2024

Good catch @Cali0707!

/test reconciler-tests

Copy link
Contributor

@creydr creydr left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks for fixing @Cali0707

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2024
Copy link

knative-prow bot commented Feb 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, creydr

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:

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

@Cali0707
Copy link
Member Author

Cali0707 commented Feb 8, 2024

/retest-required

1 similar comment
@Cali0707
Copy link
Member Author

Cali0707 commented Feb 8, 2024

/retest-required

@pierDipi
Copy link
Member

pierDipi commented Feb 9, 2024

/test reconciler-tests-namespaced-broker

@creydr
Copy link
Contributor

creydr commented Feb 9, 2024

/retest-required

@knative-prow knative-prow bot merged commit 76b1335 into knative-extensions:main Feb 9, 2024
37 checks passed
@knative-prow-robot
Copy link
Contributor

@Cali0707: new pull request created: #3688

In response to this:

/cherry-pick release-1.12

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.

@knative-prow-robot
Copy link
Contributor

@Cali0707: new pull request created: #3689

In response to this:

/cherry-pick release-1.13

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.

pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this pull request Feb 16, 2024
* fix selector path for cg scale subresource

Signed-off-by: Calum Murray <cmurray@redhat.com>

* set .status.selector properly

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: unit tests expect correct cg status

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: selector is omitted from struct when empty

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this pull request Feb 16, 2024
* fix selector path for cg scale subresource

Signed-off-by: Calum Murray <cmurray@redhat.com>

* set .status.selector properly

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: unit tests expect correct cg status

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: selector is omitted from struct when empty

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
openshift-merge-bot bot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this pull request Feb 16, 2024
…987)

* fix selector path for cg scale subresource



* set .status.selector properly



* fix: unit tests expect correct cg status



* fix: selector is omitted from struct when empty



---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Calum Murray <cmurray@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/eventing-kafka-broker that referenced this pull request Feb 16, 2024
* fix selector path for cg scale subresource

Signed-off-by: Calum Murray <cmurray@redhat.com>

* set .status.selector properly

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: unit tests expect correct cg status

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: selector is omitted from struct when empty

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/eventing-kafka-broker that referenced this pull request Feb 16, 2024
* fix selector path for cg scale subresource

Signed-off-by: Calum Murray <cmurray@redhat.com>

* set .status.selector properly

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: unit tests expect correct cg status

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: selector is omitted from struct when empty

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
openshift-merge-bot bot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this pull request Feb 19, 2024
…988)

* fix selector path for cg scale subresource



* set .status.selector properly



* fix: unit tests expect correct cg status



* fix: selector is omitted from struct when empty



---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.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 lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants