Skip to content

CAMEL-21935: Fix Knative Service missing container image on OpenShift#23804

Merged
davsclaus merged 1 commit into
mainfrom
fix/CAMEL-21935
Jun 6, 2026
Merged

CAMEL-21935: Fix Knative Service missing container image on OpenShift#23804
davsclaus merged 1 commit into
mainfrom
fix/CAMEL-21935

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Summary

  • Fix Knative Service manifest getting a bare image name (e.g., http-log:1.0-SNAPSHOT) instead of the full registry URL when deploying to OpenShift with --trait knative-service.enabled=true
  • Root cause: commit 089356d392b5 (CAMEL-21903) stopped setting the container image on the Container trait, only setting JKube build properties. This works for Deployments (JKube reads the properties), but breaks Knative Services (generated entirely by traits code, not JKube)

Root Cause

TraitHelper.configureContainerImage() sets jkube.image.name and jkube.container-image.name as Maven build properties but no longer calls containerTrait.setImage(imageToUse). Since ContainerTrait.apply() only sets the image on the container when containerTrait.getImage() is not empty, the Knative Service ends up with no image reference — Knative then resolves the bare artifact name against Docker Hub and fails with 401 Unauthorized.

Fix

Re-add containerTrait.setImage(imageToUse) in TraitHelper.configureContainerImage() so both Deployments and Knative Services get the correct image. The JKube build properties remain as-is for Maven CI/CD overridability.

Test plan

  • Updated all KubernetesExportTest assertions from assertNull(container.getImage()) to expect the correct image value
  • All existing tests pass

Claude Code on behalf of Claus Ibsen

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-plugin-kubernetes

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-plugin-kubernetes: 8 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-plugin-kubernetes. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (2 modules)
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: Launcher :: Container

⚙️ View full build and test results

@davsclaus
davsclaus merged commit 9684a54 into main Jun 6, 2026
5 checks passed
@davsclaus
davsclaus deleted the fix/CAMEL-21935 branch June 6, 2026 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant