squakez commented on a change in pull request #2309:
URL: https://github.com/apache/camel-k/pull/2309#discussion_r635923164
##########
File path: pkg/trait/builder.go
##########
@@ -59,7 +63,11 @@ func (t *builderTrait) Configure(e *Environment) (bool,
error) {
}
func (t *builderTrait) Apply(e *Environment) error {
- builderTask := t.builderTask(e)
+ builderTask, err := t.builderTask(e)
+ if err != nil {
+ // Should we clean the failing integration kit as well?
Review comment:
Thanks. I managed to fix the problem by setting an error status:
```
e.IntegrationKit.Status.Phase = v1.IntegrationKitPhaseError
e.IntegrationKit.Status.SetCondition("IntegrationKitPropertiesFormatValid",
corev1.ConditionFalse,
"IntegrationKitPropertiesFormatValid", fmt.Sprintf("One
or more properties where not formatted as expected: %s", err.Error()))
return nil
```
However, after 5 retries, I'd expect to see the condition with the error
specified in the `IntegrationKit`, but I just see a generic error:
```
status:
conditions:
- lastTransitionTime: "2021-05-20T09:07:43Z"
lastUpdateTime: "2021-05-20T09:07:43Z"
message: IntegrationPlatform (camel-k)
reason: IntegrationPlatformAvailable
status: "True"
type: IntegrationPlatformAvailable
digest: v-xWT3kPLcPJ2Lhu0eFac7eWDCCIZBCbZhIPQRWPRBxQ
failure:
reason: ""
recovery:
attempt: 5
attemptMax: 5
attemptTime: "2021-05-20T09:10:04Z"
time: "2021-05-20T09:07:48Z"
phase: Error
```
How can I provide that error message in the `IntegrationKit`. I think we
must set the failure reason to let the user know why it failed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]