-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
feat(health): add Rabbitmq topology resource customizations #22066
base: master
Are you sure you want to change the base?
feat(health): add Rabbitmq topology resource customizations #22066
Conversation
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
Signed-off-by: Francis Provencher <fprovencher@drw.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com>
8827d08
to
1c6ae59
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #22066 +/- ##
=========================================
Coverage ? 55.84%
=========================================
Files ? 342
Lines ? 57111
Branches ? 0
=========================================
Hits ? 31896
Misses ? 22587
Partials ? 2628 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Francis Provencher <fprovencher@drw.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com>
if condition.type ~= nil then | ||
if condition.type == "Ready" then | ||
if condition.status ~= nil and condition.reason ~= nil then | ||
if condition.status == "True" and condition.reason == "SuccessfulCreateOrUpdate" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you combine the nested ifs into one, e.g. condition.type ~= nil even seems unnecessary if we check for condition.type == "Ready"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, looking at the source code, if a condition is returned, it will have the type, status and reason keys, so no need to "nil check" them.
I removed the nil checks for the condition components.
if condition.type ~= nil then | ||
if condition.type == "Ready" then | ||
if condition.status ~= nil and condition.reason ~= nil then | ||
if condition.status == "True" and condition.reason == "SuccessfulCreateOrUpdate" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if condition.type ~= nil then | ||
if condition.type == "Ready" then | ||
if condition.status ~= nil and condition.reason ~= nil then | ||
if condition.status == "True" and condition.reason == "SuccessfulCreateOrUpdate" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if condition.type ~= nil then | ||
if condition.type == "Ready" then | ||
if condition.status ~= nil and condition.reason ~= nil then | ||
if condition.status == "True" and condition.reason == "SuccessfulCreateOrUpdate" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if condition.type ~= nil then | ||
if condition.type == "Ready" then | ||
if condition.status ~= nil and condition.reason ~= nil then | ||
if condition.status == "True" and condition.reason == "SuccessfulCreateOrUpdate" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if condition.type ~= nil then | ||
if condition.type == "Ready" then | ||
if condition.status ~= nil and condition.reason ~= nil then | ||
if condition.status == "True" and condition.reason == "SuccessfulCreateOrUpdate" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, make ifs less nested (some not commented specifically)
Signed-off-by: Francis Provencher <fprovencher@drw.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com>
Kept it simple.
There are only 2 defined states (on top of unknown) as per: https://github.com/rabbitmq/messaging-topology-operator/blob/0c910d977b21b4610b789a90e7edfc8ca42d9649/api/v1beta1/conditions.go#L26
Checklist: