-
Notifications
You must be signed in to change notification settings - Fork 148
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
update: change dsci monitoring type #1373
base: incubation
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I'm not arguing, but any background why it's needed? Just general improvement or some request? |
was finding during the namespace test. #1321 |
Could you describe how it is supposed to work? Probably, In my check both work equally. I mean, if I create dsci with explicit value for monitoring state, it preserved, otherwise it is omitted. Should it be configured with default value? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## incubation #1373 +/- ##
=============================================
Coverage ? 18.88%
=============================================
Files ? 30
Lines ? 3404
Branches ? 0
=============================================
Hits ? 643
Misses ? 2692
Partials ? 69 ☔ View full report in Codecov by Sentry. |
realize that i put a wrong description yesterday which caused confusion. |
2599747
to
48b2d0c
Compare
pkg/common/common.go
Outdated
@@ -116,3 +120,10 @@ func GetMonitoringData(data string) (string, error) { | |||
|
|||
return encodedData, nil | |||
} | |||
|
|||
func IsMonitoringEnabled(dscMonitoring *dsciv1.Monitoring) bool { | |||
if dscMonitoring != nil && dscMonitoring.ManagementState == operatorv1.Managed { |
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.
It's return dscMonitoring != nil && dscMonitoring.ManagementState == operatorv1.Managed
(probably shorter parameter name works better for one line)
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.
you mean something like:
func IsMonitoringEnabled(monitoring *dsciv1.Monitoring) bool {
if monitoring != nil && monitoring.ManagementState == operatorv1.Managed {
?
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.
Like this
func IsMonitoringEnabled(m *dsciv1.Monitoring) bool {
return m != nil && m.ManagementState == operatorv1.Managed
}
since for such a short code it's obvious from the declaration what m
means.
But I do not insist.
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.
updated
Thanks! I have the yaml:
in both cases.
does not change anything.
in both cases. |
you are saying,
when DSCI is in Ready status, you get result from
but not:
|
[...]
[...]
Well, I'm saying that it is the same for both cases for me, but I rechecked and no, you are right, it works as expected/you described. |
looks good to me |
- move check into a function - fix the case when user remove entire monitoring block from DSCI Signed-off-by: Wen Zhou <[email protected]>
update: change dsci monitoring type:
move check into a function
fix the case when user remove entire monitoring block from DSCI, it should not still show namespace and cause confusion
Description
when in ODH or self-managed case, user can chose to either set monitoring.managementstate to remove or remove the default monitoring block, in order to disable monitoring function.
for the 2nd case "remove monitoring block"
by doing like this to create/patch DSCI
yaml:
with the PR(pointer) after DSCI is updated:
with the current incubation (struct) after DSCI is updated:
related but not to fix https://issues.redhat.com/browse/RHOAISTRAT-407
How Has This Been Tested?
create DSCI with need sepcifiy monitoring namespace:
Screenshot or short clip
Merge criteria