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

fix: camel-k ignores changes to traits configured using annotations #3480

Merged
merged 3 commits into from
Aug 5, 2022

Conversation

lburgazzoli
Copy link
Contributor

@lburgazzoli lburgazzoli commented Jul 24, 2022

Release Note

NONE

Fixes #3479

@lburgazzoli lburgazzoli changed the title fix: camel-k ignores changes to traits configured using annotations #3479 fix: camel-k ignores changes to traits configured using annotations Jul 24, 2022
@lburgazzoli lburgazzoli force-pushed the github-3479 branch 6 times, most recently from 017897c to fd1666a Compare July 25, 2022 14:08
@lburgazzoli lburgazzoli marked this pull request as ready for review July 26, 2022 09:07
@lburgazzoli
Copy link
Contributor Author

@squakez @tadayosi @christophd can you ahve a look ? btw I'm not sure if that's the proper way to solve the issue but

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

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

Good for me. Just a couple of comments though.

@@ -75,6 +77,109 @@ func newReconciler(mgr manager.Manager, c client.Client) reconcile.Reconciler {
)
}

func integrationUpdateFunc(old *v1.Integration, it *v1.Integration) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for encapsulating these functions. However, I could not understand if there is any logic change in them or it was just the encapsulation which changed. Can you clarify?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the linter was complaining about complexity of the method so I created dedicated functions to make the method more readable.

}
}

return integrationMatches(integration, kit)
Copy link
Contributor

Choose a reason for hiding this comment

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

I've just fixed another possibly related issue here #3487. In that case it was failing because the match always returned false when an IntegrationKit was on error. Not sure if there is any check in the integrationMatches that is influencing the failure here, and if it makes sense to revisit it. I'd expect the integrationMatches to take care of those new added conditions as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For what I understood, in the case the status of a kit should not influence the trigger as in fact every change to a kit should result in a reconcile being triggered. Then the integration controller should decide what to do so I guess your changes are improving also this case.

Copy link
Member

@tadayosi tadayosi left a comment

Choose a reason for hiding this comment

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

Apart from my comments, there's one silently failing e2e test in common-it. I'd like to check if it's really not related to this pull req or not.

2022-07-25T15:08:07.0934307Z === RUN   TestKameletBindingScale
...
2022-07-25T15:10:44.4605241Z     scale_binding_test.go:58: 
2022-07-25T15:10:44.4605677Z         Timed out after 60.003s.
2022-07-25T15:10:44.4606001Z         Expected
2022-07-25T15:10:44.4606444Z             <v1.ConditionStatus>: False
2022-07-25T15:10:44.4606760Z         to equal
2022-07-25T15:10:44.4607175Z             <v1.ConditionStatus>: True

See #3465 for the issue of e2e silently failing. It's already fixed in the main branch.

pkg/controller/integration/kits.go Outdated Show resolved Hide resolved
pkg/trait/util.go Outdated Show resolved Hide resolved
pkg/trait/util.go Outdated Show resolved Hide resolved
pkg/trait/util.go Outdated Show resolved Hide resolved
pkg/controller/integration/kits.go Show resolved Hide resolved
@lburgazzoli lburgazzoli marked this pull request as draft July 27, 2022 12:25
@lburgazzoli lburgazzoli force-pushed the github-3479 branch 2 times, most recently from f83de21 to fdf1818 Compare July 27, 2022 20:43
@lburgazzoli lburgazzoli marked this pull request as ready for review July 27, 2022 20:43
@lburgazzoli lburgazzoli force-pushed the github-3479 branch 2 times, most recently from 8e3aea7 to 8c58d16 Compare July 27, 2022 21:16
Copy link
Member

@tadayosi tadayosi left a comment

Choose a reason for hiding this comment

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

Great refactoring!

@lburgazzoli
Copy link
Contributor Author

@tadayosi @christophd I see knative test failing but I'm unsure if they are related to this change or not. I may need some help to troubleshoot the failure

@tadayosi
Copy link
Member

tadayosi commented Aug 1, 2022

@lburgazzoli We've done a lot of efforts to stabilise the e2e tests and now they are reilable enough to keep all green before merging a pull req. The fact that knative/yaks fails 3 times out of 3 suggests it's likely some changes in this fix have caused it.

I'm not knowledgeable about the yaks test either but I'd start from replicating the automated test manually and see what's causing this error:

error: timed out waiting for the condition on kameletbindings/timer-source-binding-display

Copy link
Member

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

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

Few comments, otherwise LGTM 👍🏼.

e2e/support/test_support.go Outdated Show resolved Hide resolved
e2e/global/common/kamelet_binding_with_image_test.go Outdated Show resolved Hide resolved
pkg/trait/util.go Outdated Show resolved Hide resolved
pkg/controller/kameletbinding/monitor.go Outdated Show resolved Hide resolved
pkg/controller/kameletbinding/monitor.go Outdated Show resolved Hide resolved
pkg/controller/integration/integration_controller.go Outdated Show resolved Hide resolved
pkg/controller/integration/integration_controller.go Outdated Show resolved Hide resolved
@lburgazzoli
Copy link
Contributor Author

Few comments, otherwise LGTM 👍🏼.

Suggestions have been implemented, I guess the overall logging stuff may need to be improved

@lburgazzoli
Copy link
Contributor Author

@christophd I may need some help trying to understand what the failure is about

kamelet-binding-http (kamelet-binding-http): Failure caused by InitializationError - Failed to run installation: exit status 1

pkg/trait/util.go Outdated Show resolved Hide resolved
… on the traits configured on the KameletBinding only apache#3479
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.

camel-k ignores changes to traits configured using annotations
6 participants