squakez commented on code in PR #4021:
URL: https://github.com/apache/camel-k/pull/4021#discussion_r1095489402


##########
pkg/client/camel/applyconfiguration/camel/v1/integrationkitspec.go:
##########
@@ -96,3 +97,16 @@ func (b *IntegrationKitSpecApplyConfiguration) 
WithRepositories(values ...string
        }
        return b
 }
+
+// WithSources adds the given value to the Sources field in the declarative 
configuration
+// and returns the receiver, so that objects can be build by chaining "With" 
function invocations.
+// If called multiple times, values provided by each call will be appended to 
the Sources field.
+func (b *IntegrationKitSpecApplyConfiguration) WithSources(values 
...*SourceSpecApplyConfiguration) *IntegrationKitSpecApplyConfiguration {
+       for i := range values {
+               if values[i] == nil {
+                       panic("nil value passed to WithSources")

Review Comment:
   ditto



##########
pkg/client/camel/applyconfiguration/camel/v1/buildertask.go:
##########
@@ -96,3 +97,16 @@ func (b *BuilderTaskApplyConfiguration) WithBuildDir(value 
string) *BuilderTaskA
        b.BuildDir = &value
        return b
 }
+
+// WithSources adds the given value to the Sources field in the declarative 
configuration
+// and returns the receiver, so that objects can be build by chaining "With" 
function invocations.
+// If called multiple times, values provided by each call will be appended to 
the Sources field.
+func (b *BuilderTaskApplyConfiguration) WithSources(values 
...*SourceSpecApplyConfiguration) *BuilderTaskApplyConfiguration {
+       for i := range values {
+               if values[i] == nil {
+                       panic("nil value passed to WithSources")

Review Comment:
   We should not panic but report the error and set the related CR status to 
error.



##########
pkg/trait/quarkus.go:
##########
@@ -47,6 +47,57 @@ type quarkusTrait struct {
        BaseTrait
        traitv1.QuarkusTrait `property:",squash"`
 }
+type languageSettings struct {

Review Comment:
   This information would depend on the catalog. We should parse the catalog 
and use those values accordingly.



##########
pkg/trait/quarkus.go:
##########
@@ -216,6 +265,9 @@ func (t *quarkusTrait) newIntegrationKit(e *Environment, 
packageType traitv1.Qua
                Traits:       propagateKitTraits(e),
        }
 
+       if packageType == traitv1.NativePackageType {
+               kit.Spec.Sources = propagateSourcesRequiredAtBuildTime(e)

Review Comment:
   +1 good to include only when native



##########
pkg/trait/trait_test.go:
##########
@@ -267,22 +267,23 @@ func TestConfigureVolumesAndMountsSources(t *testing.T) {
                                Sources: []v1.SourceSpec{
                                        {
                                                DataSpec: v1.DataSpec{
-                                                       Name:       
"source1.java",
+                                                       Name:       
"source1.xml",

Review Comment:
   why changing this test?



-- 
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]

Reply via email to