davsclaus opened a new pull request, #29932: URL: https://github.com/apache/camel/pull/29932
Item 4 of [CAMEL-26934](https://issues.apache.org/jira/browse/CAMEL-26934): options dropped for a CronJob and a Knative Service. ## Problem `camel kubernetes export` with `--env`, `--config`, `--volume` and `--annotation` and the CronJob trait exited 0, and none of them was in `cronjob.yml`. A Knative Service lost the env and the labels, including `app.kubernetes.io/runtime`. - **`EnvTrait`** was not used without a Deployment (its `configure` returned false), and applied the variables to the Deployment only. - **`MountTrait`** added the volumes and mounts to the Deployment only. - **`LabelTrait`** labelled the Deployment, the Service and the CronJob, but not the Knative Service. - **`AnnotationTrait`** annotated the Deployment, the Service and the Knative Service, but not the CronJob. ## Change Each of these traits now applies to the workload there is: a Deployment, a CronJob (its job template's pod) or a Knative Service (its template). - `EnvTrait` is used when there is any of them, and adds the variables to the first container of each. - `MountTrait` adds the volumes and mounts to the CronJob and the Knative Service too. - `LabelTrait` labels the Knative Service (`app.kubernetes.io/name` and the labels of the export, such as `app.kubernetes.io/runtime`). - `AnnotationTrait` annotates the CronJob. The duplicate volume names of item 5 (`--config configmap:db --config secret:db`) are not in this PR: fixing them changes the names of the generated volumes. ## Tests - `KubernetesExportTest.theOptionsOfTheWorkloadApplyToACronjob`: `--env`, `--config=configmap:my-cm` and `--annotation` are in the CronJob, for each runtime. - `KubernetesExportKnativeTest.theOptionsOfTheWorkloadApplyToAKnativeService`: `--env`, `--config` and `--label` are in the Knative Service. - `KubernetesExportKnativeTest.shouldAddKnativeServiceSpec`: the Knative Service has 9 labels now, with `app.kubernetes.io/runtime=camel`. - camel-jbang-plugin-kubernetes: 162 tests pass. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
