hernanDatgDev commented on code in PR #4987:
URL: https://github.com/apache/camel-k/pull/4987#discussion_r1428123693
##########
pkg/controller/integration/kits.go:
##########
@@ -257,10 +259,32 @@ func matchesTrait(it map[string]interface{}, kt
map[string]interface{}) bool {
}
func hasMatchingSources(it *v1.Integration, kit *v1.IntegrationKit) bool {
- if len(it.Sources()) != len(kit.Spec.Sources) {
+ // A kit may have fewer sources during native builds but should not
have more
+ if len(kit.Spec.Sources) > len(it.Sources()) {
return false
}
+
+ isNativeKit := false
+ if kit.Spec.Traits.Quarkus != nil {
+ // TODO: Verify proper way to determine mode
+ mode := kit.Spec.Traits.Quarkus.Modes[0]
+ isNativeKit = mode == traitv1.NativeQuarkusMode
+ }
+
+ var kitRuntimeCatalog *camel.RuntimeCatalog
+ if isNativeKit {
+ var err error
+ kitRuntimeCatalog, err =
camel.GetVersionedCatalog(kit.Status.RuntimeVersion)
+ if err != nil {
+ // TODO: log error here?
+ return false
+ }
+ }
+
for _, itSource := range it.Sources() {
+ if isNativeKit && !sourceRequiredByKitCatalog(itSource,
kitRuntimeCatalog) {
Review Comment:
Is it safe to assume that all generated sources never need to be included in
the kits? `propagateSourcesRequiredAtBuildTime` ultimately takes a look at the
sources language so is it possible that a source might be generated in a
language that is required at build time?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]