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

Sugar controller doesn't enforce Broker class #6500

Merged
merged 3 commits into from Oct 5, 2022

Conversation

gab-satchi
Copy link
Contributor

@gab-satchi gab-satchi commented Aug 26, 2022

  • 🐛 Fixes issue where sugar controller was forcing Broker class.

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

To reproduce:

  • Update the defaults ConfigMap config-br-defaults to use RabbitMQBroker along with an appropriate broker config.
  • Enable sugar controller
  • Create a new namespace or trigger with the appropriate label

Expected:

  • default broker is created with configuration and class matching the defaults config map

Actual:

  • default broker is created with the RabbitMQ broker config but with the class still set to MTChannelBasedBroker
Fixes issue with sugar controller always setting the broker class to MTChannelBasedBroker instead of using the defaults ConfigMap

Relies on this pkg PR to be merged and integrated for tests to pass

/hold until pkg merge

@knative-prow knative-prow bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 26, 2022
@matzew
Copy link
Member

matzew commented Aug 31, 2022

One thing that I noticed is these hard-coded defaults:
https://github.com/knative/eventing/blob/main/pkg/reconciler/sugar/resources/broker.go#L35

Should we actually honor what's configured as default broker - instead of the above assumption?

@gab-satchi
Copy link
Contributor Author

I think the hardcoded default may have been an oversight. The hard coded default means the sugar controller will not work with any broker class other than the MTBroker.

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 3, 2022
@codecov
Copy link

codecov bot commented Oct 3, 2022

Codecov Report

Base: 82.09% // Head: 81.94% // Decreases project coverage by -0.15% ⚠️

Coverage data is based on head (1e06cc5) compared to base (db235e7).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6500      +/-   ##
==========================================
- Coverage   82.09%   81.94%   -0.16%     
==========================================
  Files         235      235              
  Lines       11714    11737      +23     
==========================================
+ Hits         9617     9618       +1     
- Misses       1628     1646      +18     
- Partials      469      473       +4     
Impacted Files Coverage Δ
pkg/reconciler/sugar/resources/broker.go 100.00% <100.00%> (ø)
pkg/channel/message_receiver.go 64.22% <0.00%> (-9.82%) ⬇️
pkg/scheduler/statefulset/scheduler.go 79.13% <0.00%> (-2.80%) ⬇️
pkg/channel/message_dispatcher.go 81.15% <0.00%> (-0.90%) ⬇️
pkg/scheduler/scheduler.go 100.00% <0.00%> (ø)
...labilityzonepriority/availability_zone_priority.go 82.60% <0.00%> (+11.18%) ⬆️
...labilitynodepriority/availability_node_priority.go 81.39% <0.00%> (+11.18%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gab-satchi
Copy link
Contributor Author

@pierDipi, The PR for the bug I was fixing. It now uses a defaulter reactor instead of modifying pkg code.

@gab-satchi
Copy link
Contributor Author

/hold cancel

@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 Oct 3, 2022
Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

Thanks!

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 5, 2022
@knative-prow
Copy link

knative-prow bot commented Oct 5, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gab-satchi, pierDipi

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

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 5, 2022
@knative-prow knative-prow bot merged commit af2298f into knative:main Oct 5, 2022
27 of 34 checks passed
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. 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.

None yet

3 participants