lburgazzoli commented on code in PR #5230: URL: https://github.com/apache/camel-k/pull/5230#discussion_r1516882356
########## pkg/trait/builder.go: ########## @@ -56,9 +57,18 @@ func (t *builderTrait) InfluencesKit() bool { return true } -// InfluencesBuild overrides base class method. -func (t *builderTrait) InfluencesBuild(this, prev map[string]interface{}) bool { - return true +func (t *builderTrait) Matches(trait Trait) bool { + otherTrait, ok := trait.(*builderTrait) + if !ok { + return false + } + if t.BaseImage != otherTrait.BaseImage || len(t.Properties) != len(otherTrait.Properties) { + return false + } + // More sofisticated check if len is the same. Sort and compare via slices equal func. + slices.Sort(t.Properties) + slices.Sort(otherTrait.Properties) Review Comment: nitpick: this method has a side effect as it alters the order of both the current and the other trait properties. -- 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. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org