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

Build configuration on IntegrationPlatform ignored #5289

Closed
christophd opened this issue Mar 27, 2024 · 2 comments · Fixed by #5383
Closed

Build configuration on IntegrationPlatform ignored #5289

christophd opened this issue Mar 27, 2024 · 2 comments · Fixed by #5383
Labels
kind/bug Something isn't working
Milestone

Comments

@christophd
Copy link
Contributor

What happened?

The IntegrationPlatform spec is able to hold build configuration settings that should be applied to the integration image builds. However, some settings are ignored when set on the IntegrationPlatform (e.g. build.buildConfiguration.platforms).

Status of the Integration platform after adding the setting:

#...
  status:
    build:
      baseImage: arm64v8/eclipse-temurin:17
      buildConfiguration:
        orderStrategy: sequential
        platforms:
        - linux/amd64
        - linux/arm64
        strategy: routine
#...

I would expect the operator to use a setting -Djib.from.platforms=linux/arm64 but it is not there (see logs below).

When the platform is set via trait option on the integration (kamel run simple.groovy -t builder.platforms="linux/arm64") it works and I can see the setting -Djib.from.platforms=linux/arm64 is being used during the integration image build as expected.

Users should be able to set this also on IntegrationPlatform level for all integrations.

Steps to reproduce

  1. Install Camel K 2.3.0-SNAPSHOT
  2. patch the IntegrationPlatform to add build configuration (k patch itp camel-k --type=merge -p '{"spec":{"build": { "buildConfiguration": {"platforms": ["linux/amd64","linux/arm64"]}}}}')
  3. Review the integration platform status to have the setting applied
  4. run integration and review the operator log to use the setting -Djib.from.platforms=linux/arm64 during the build

Relevant log output

{"level":"info","ts":"2024-03-27T08:49:31Z","logger":"camel-k.maven.build","msg":"Executed command: ./mvnw jib:build -V --no-transfer-progress -Dstyle.color=never -Dmaven.repo.local=/etc/maven/m2 --global-settings /tmp/kit-co1tqo3ui44s7386ui00-557093953/maven/settings.xml -Dmaven.artifact.threads=4 -T 4 -P jib -Djib.to.image=10.96.46.247/camel-system/camel-k-kit-co1tqo3ui44s7386ui00:39034 -Djib.from.image=arm64v8/eclipse-temurin:17 -Djib.allowInsecureRegistries=true"}

Camel K version

2.3.0-SNAPSHOT

@christophd christophd added the kind/bug Something isn't working label Mar 27, 2024
@squakez squakez added this to the 2.4.0 milestone Apr 5, 2024
@squakez
Copy link
Contributor

squakez commented Apr 18, 2024

@christophd are you sure this is happening with version 2.3.0? Just tested and it work as expected:

kamel run test.yaml -t builder.platforms="linux/arm64"
...
camel-k-operator-56cbd4ff78-h4z5g camel-k-operator {"level":"info","ts":"2024-04-18T14:01:34Z","logger":"camel-k.maven.build","msg":"Executed command: ./mvnw jib:build -V --no-transfer-progress -Dstyle.color=never -Dmaven.repo.local=/etc/maven/m2 --global-settings /tmp/kit-cogif7of9h2c73aouqu0-2355704660/maven/settings.xml -Dmaven.artifact.threads=8 -T 8 -P jib -Djib.to.image=10.103.186.147/default/camel-k-kit-cogif7of9h2c73aouqu0:1233624 -Djib.from.image=eclipse-temurin:17 -Djib.baseImageCache=/tmp/kit-cogif7of9h2c73aouqu0-2355704660/maven/jib -Djib.from.platforms=linux/arm64 -Djib.allowInsecureRegistries=true"}
....
$ docker inspect 69cdd648323b
...
        "Architecture": "arm64",
        "Os": "linux",

@squakez squakez added status/waiting-for-feedback Needs some feedback and removed status/waiting-for-feedback Needs some feedback labels Apr 18, 2024
@squakez
Copy link
Contributor

squakez commented Apr 18, 2024

Ah, I think I miss to read the second part, like it fails to execute when the property are set outside the trait. Gonna checking right now.

squakez added a commit to squakez/camel-k that referenced this issue Apr 18, 2024
squakez added a commit that referenced this issue Apr 19, 2024
squakez added a commit to squakez/camel-k that referenced this issue Apr 19, 2024
squakez added a commit that referenced this issue Apr 19, 2024
squakez added a commit to jboss-fuse/camel-k that referenced this issue Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants