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

[issue-521] Enhance error messages in SonataFlowPlatform CR status for knative integration #558

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

jianrongzhang89
Copy link
Contributor

@jianrongzhang89 jianrongzhang89 commented Oct 23, 2024

Description of the change:
Fix #521.
Note that we have decided to use K8s events instead of status conditions to notify the user that the broker is not available.

Motivation for the change:
To facilitate troubleshooting of configuration issues.

Checklist

  • Add or Modify a unit test for your change
  • Have you verified that tall the tests are passing?

@jianrongzhang89 jianrongzhang89 force-pushed the error-message branch 3 times, most recently from 293032b to ce270cd Compare October 24, 2024 14:42
@jianrongzhang89 jianrongzhang89 marked this pull request as ready for review October 29, 2024 01:10
Copy link
Contributor

@wmedvede wmedvede left a comment

Choose a reason for hiding this comment

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

@jianrongzhang89 @ricardozanini
A minor non-blocking suggestion from my side guys if we have time.

}
if !kSinkInjected {
return fmt.Errorf("waiting for K_SINK injection for %s to complete", psh.GetServiceName())
msg := fmt.Sprintf("waiting for K_SINK injection for %s to complete", psh.GetServiceName())
Copy link
Contributor

Choose a reason for hiding this comment

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

This is good, we can see the service name in the event.

event := &corev1.Event{
Type: corev1.EventTypeWarning,
Reason: WaitingKnativeEventing,
Message: err.Error(),
Copy link
Contributor

@wmedvede wmedvede Oct 30, 2024

Choose a reason for hiding this comment

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

For this error message it would be nice if we can see the service name as part of the message.

I have forced the use case to happen, and in the events I can see:

5m47s Warning WaitingKnativeEventing sonataflowplatform/sonataflow-platform broker sonataflow-broker in namespace case1-kn-eventing does not exist
13m Warning Failed sonataflowplatform/sonataflow-platform Failed to update SonataFlowPlaform: broker sonataflow-broker in namespace case1-kn-

So, it's difficult to distinguish for which service we have the missing broker.

If it's not too much work, it would suggest that we include the name of the service as part of the message.
I think we can just grab the ValidatBroker message and concatenate "service" + d.GetServiceName()

and we can see:

sonataflow-broker in namespace case1-kn-eventing does not exist for service: sonataflow-platform-data-index

Considering that the configuration alternatives admits different Brokers for DI and JS, I think it'll be very helpful in situations where users needs to query the events to find the cause of the issue

Copy link
Contributor

Choose a reason for hiding this comment

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

Same for the jobs-service knative addings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @wmedvede for the suggestion. This sounds good to me. Code is updated.

Copy link
Contributor

Choose a reason for hiding this comment

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

Many thanks!

@wmedvede wmedvede merged commit c0e6a4d into apache:main Oct 31, 2024
4 checks passed
rgdoliveira pushed a commit to rgdoliveira/kogito-serverless-operator that referenced this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance error messages in SonataFlowPlatform CR status for knative integration
3 participants