-
Notifications
You must be signed in to change notification settings - Fork 104
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
Feature/advanced error handling #294
base: master
Are you sure you want to change the base?
Feature/advanced error handling #294
Conversation
merge latest
…stem and pingdom monitor with method that prevents duplicated check creation
@artemlive Yikes! You better fix it before anyone else finds out! Build 1 has Failed! |
@artemlive Yikes! You better fix it before anyone else finds out! Build 2 has Failed! |
@artemlive Yikes! You better fix it before anyone else finds out! Build 3 has Failed! |
@artemlive Yikes! You better fix it before anyone else finds out! Build 4 has Failed! |
@artemlive Yikes! You better fix it before anyone else finds out! Build 5 has Failed! |
@artemlive Yikes! You better fix it before anyone else finds out! Build 6 has Failed! |
@artemlive Yikes! You better fix it before anyone else finds out! Build 7 has Failed! |
Strange thing, because all tests have been passed locally.
|
@artemlive Yikes! You better fix it before anyone else finds out! Build 8 has Failed! |
@artemlive Yikes! You better fix it before anyone else finds out! Build 9 has Failed! |
Linter, tests, and builds are fine |
@artemlive Yikes! You better fix it before anyone else finds out! Build 10 has Failed! |
Hi @artemlive, everything was fine but the test cases were failing against a different provider. I am looking into it and hopefully will resolve that today. |
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.
Hi, please merge the latest master in your branch. Also, there are a fw issues with the PR:
- You have replaced errors with logs at a lot of places which i don't get it that why is it required
- For test cases, remove the
provider == nil
check since that is something i have already handled and we don't want an error in there.
monitor, err := findMonitorByName(r.monitorServices[index], monitorName) | ||
// if there was some error while getting a monitor, re-queue it to try on the next reconcile iteration | ||
if err != nil { | ||
return reconcile.Result{RequeueAfter: RequeueTime}, err | ||
} |
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 it's unable to create a monitor this will be an endless re-conciliation loop !
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.
But if it was only the API call error? E.g. API has returned 500 code, and we would be able to add this monitor on the next iteration?
if err != nil { | ||
log.Errorf("Error while handling update: %s", err) | ||
return reconcile.Result{RequeueAfter: RequeueTime}, err | ||
} |
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.
This is redundant since it already requeue's after create or update action:
https://github.com/stakater/IngressMonitorController/blob/master/pkg/controller/endpointmonitor/endpointmonitor_controller.go#L135
if err != nil { | ||
log.Errorf("Error while handling create: %s", err) | ||
return reconcile.Result{RequeueAfter: RequeueTime}, err | ||
} |
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.
This is redundant since it already requeue's after create or update action:
https://github.com/stakater/IngressMonitorController/blob/master/pkg/controller/endpointmonitor/endpointmonitor_controller.go#L135
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.
Thanks, I'll fix that.
log.Printf("Application Insights WebTest %s was not found in Resource Group %s", monitorName, aiService.resourceGroup) | ||
return nil, nil |
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.
Why are we removing this error from here ?
log.Printf("There is no gcloud MonitorService with name %s found.", name) | ||
return nil, nil |
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.
Why are we removing this error from here ?
log.Printf("There is no PingdomMonitorService with name %s found.", name) | ||
return nil, nil |
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.
Why are we removing this error from here ?
log.Printf("There is no StatusCakeMonitorService with name %s found.", name) | ||
return nil, nil |
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.
Why are we removing this error from here ?
…ntroller into feature/advanced-error-handling
@artemlive Image is available for testing. |
@artemlive can you plz resolve the conflicts and lets get this merged? |
@artemlive any plans to update this PR? |
Any update on this?? Would be great to have |
@@ -82,6 +84,26 @@ func (service *PingdomMonitorService) GetAll() []models.Monitor { | |||
return monitors | |||
} | |||
|
|||
// Function that gets all monitors with an error handling to avoid duplicate checks creation | |||
func (service *PingdomMonitorService) GetAllWithAPIErrorHandler() ([]models.Monitor, error) { |
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.
I don't know how this function can avoid duplication compared with the existing GetAll() one?
I'm glad I found this PR, I was about to start working on something similar. Any chance this will make progress soon? |
Is there any ETA for merging this PR and releasing a new version? Thanks! |
Hello, we also would like this PR to be merged, thanks for your help ! |
Hello, folks! I'm sorry for being gone so long. I'll review all the code and fix the conflicts as soon as possible. |
@artemlive have you had time to look at this again? |
@artemlive Any chance you'll get time to actually look at this soon? |
@artemlive I would also be very curious if there is any update to this matter? :) |
Here is the issue with the detailed description of this improvement: #293