Thundercloud12 opened a new pull request, #6855:
URL: https://github.com/apache/camel-k/pull/6855
### Motivation
Currently, an `IntegrationProfile` must be explicitly selected by annotating
each individual `Integration` (or
`Pipe`) resource with `camel.apache.org/integration-profile.id`. This
requires developers to manually annotate every
resource and prevents namespace administrators from defining standard
default profile settings for all integrations
in a given namespace.
### Changes
This PR introduces default `IntegrationProfile` resolution support, allowing
integrations to inherit a default
profile without explicit per-resource annotations. The operator now resolves
profiles using the following order of
precedence:
1. **Resource Annotation:** `camel.apache.org/integration-profile.id` on the
resource (`Integration`, `Pipe`).
2. **Namespace Annotation:** `camel.apache.org/integration-profile.id` on
the Kubernetes `Namespace`.
3. **`default` Profile Convention:** An `IntegrationProfile` named `default`
in the same namespace.
4. **Operator Default:** Operator baseline configuration if no profile is
defined.
#### Key Updates
- **Profile Resolution (`pkg/platform/profile.go`):** Updated
`findIntegrationProfile` to implement the fallback
sequence (Resource Annotation → Namespace Annotation → `default`
IntegrationProfile → Operator Defaults).
- **Constant (`pkg/apis/camel/v1/common_types.go`):** Added
`DefaultIntegrationProfileName = "default"`.
- **RBAC (`helm/` & `pkg/resources/config/rbac/`):** Added `get` permission
on `namespaces` for descoped roles
so the operator can inspect namespace annotations.
- **Unit Tests (`pkg/platform/profile_test.go`):** Added comprehensive unit
tests validating resolution precedence,
fallback behavior, and missing profile error handling.
- **Documentation
(`docs/modules/ROOT/pages/configuration/integrationprofiles.adoc`):** Added
documentation
explaining the resolution precedence and showing examples for namespace
annotations and the `default` profile
convention.
--
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]