Skip to content

Fix #6776: Default IntegrationProfile support - #6855

Open
Thundercloud12 wants to merge 4 commits into
apache:mainfrom
Thundercloud12:feature/6776-default-integration-profile
Open

Thundercloud12 wants to merge 4 commits into
apache:mainfrom
Thundercloud12:feature/6776-default-integration-profile

Conversation

@Thundercloud12

@Thundercloud12 Thundercloud12 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

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.

Fixes: #6776

@squakez squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool work, thanks!

Comment thread docs/modules/ROOT/pages/configuration/integrationprofiles.adoc
Comment thread pkg/resources/config/rbac/descoped/operator-cluster-role.yaml
@github-actions

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 63.8% to 63.9% (+0.1%)

@Thundercloud12

Copy link
Copy Markdown
Contributor Author

@squakez i have done the changes as requested by you!

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 64.4% to 64.5% (+0.1%)

@squakez

squakez commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Maybe it requires a rebase with main as we have fixed issues with registry lately.

@Thundercloud12

Copy link
Copy Markdown
Contributor Author

I, along with an ai agent, investigated the CI failures, and the agent suggested the following root cause and fix.

Root cause:

  • In namespaced mode, the operator lacks cluster-wide permissions to list/watch Kubernetes Namespaces.
  • Fetching a Namespace through the cached client may trigger an informer that fails to synchronize.
  • The resulting cache synchronization error is not recognized by the existing Forbidden error check, causing reconciliation to fail.

Proposed fix:

  1. Disable caching for corev1.Namespace so namespace lookups use direct API requests.
  2. If the namespace lookup fails, continue profile resolution using the default profile or operator configuration instead of failing reconciliation.

Verification reported by the agent:

  • The namespaced integration test passed locally.
  • Relevant unit tests passed.
  • Formatting and lint checks passed.

Before proceesind i want to ask this with you does this diagnosis makes sense? as this is a diagnosis did by an agent i cant trust it completely, although to me it might seem good at first but i am not someone experienced in this repo and might introduce some unintended changes that are not meant to be there in the first place

@squakez

squakez commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Not sure about that, it does not really seem a reason for the failure. I invite you to rebase with the actual main before doing any further analysis as there were stability fixes that may solve this situation. It's an easy one we can try before diving more into investigations.

@Thundercloud12
Thundercloud12 force-pushed the feature/6776-default-integration-profile branch from 5cb83ad to 49ea82a Compare October 16, 2026 12:30
@Thundercloud12

Copy link
Copy Markdown
Contributor Author

@squakez rebased it

@github-actions

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 64.6% to 64.7% (+0.1%)

@squakez

squakez commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

I think this one depends on the fix done in #6887 . Once that is merged, we probably need to adjust this with the changes required in the other PR in order to avoid the failures seen in this PR.

@squakez

squakez commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

@Thundercloud12 please, rebase this one as it may be all green after the rebase and we can merge.

  'origin/main' into feature/6776-default-
  integration-profile
@Thundercloud12

Copy link
Copy Markdown
Contributor Author

@squakez please have a look now

@squakez

squakez commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

I will have a look at the check failures and try to solve them on this PR (which, for the rest, seems complete)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default IntegrationProfile

2 participants