Skip to content

feat(pluginpresets): pluginpreset controller resolves values from references#2117

Open
k-fabryczny wants to merge 44 commits into
mainfrom
feat/v4-CEL-in-pp-1776
Open

feat(pluginpresets): pluginpreset controller resolves values from references#2117
k-fabryczny wants to merge 44 commits into
mainfrom
feat/v4-CEL-in-pp-1776

Conversation

@k-fabryczny

Copy link
Copy Markdown
Contributor

Description

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

#1776

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Copilot AI review requested due to automatic review settings July 3, 2026 14:30
@k-fabryczny
k-fabryczny requested review from a team as code owners July 3, 2026 14:30
@github-actions github-actions Bot added documentation Improvements or additions to documentation feature helm-charts size/XXL labels Jul 3, 2026

Copilot AI 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.

Pull request overview

This PR extends the PluginPreset controller to resolve valueFrom.ref references (to other PluginPresets) into concrete spec.optionValues[*].value entries on the generated Plugins, controlled via a new pluginPreset.integrationEnabled feature flag. It also updates Helm chart feature-flag wiring, adds extensive controller/e2e tests, and expands the PluginPreset documentation to cover cross-preset references.

Changes:

  • Add pluginPreset.integrationEnabled feature flag plumbed through features, controller wiring, and Helm charts.
  • Implement valueFrom.ref resolution in the PluginPreset controller (including selector-based fan-out and CEL extraction).
  • Add/extend unit and E2E scenarios and documentation for cross-PluginPreset references.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/features/features.go Adds IsPresetIntegrationEnabled() and supporting struct field.
internal/features/features_test.go Extends feature-flag tests to cover preset integration flag.
internal/controller/plugin/suite_test.go Enables preset integration in controller test suite setup.
internal/controller/plugin/pluginpreset_values_resolver.go Implements reference resolution and CEL evaluation for valueFrom.ref.
internal/controller/plugin/pluginpreset_controller.go Adds IntegrationEnabled flag to reconciler struct.
internal/controller/plugin/pluginpreset_controller_test.go Adds multiple integration tests for cross-preset references.
e2e/pluginpreset/scenarios/selector_reference.go New E2E scenario: selector-based cross-preset reference.
e2e/pluginpreset/scenarios/cross_preset_reference.go New E2E scenario: name-based cross-preset reference.
e2e/pluginpreset/scenarios/cross_preset_reference_overrides.go New E2E scenario: references respect source ClusterOptionOverrides.
e2e/pluginpreset/scenarios/constants.go Adds constants for new E2E scenarios.
e2e/pluginpreset/e2e_test.go Registers new PluginPreset reference E2E scenarios.
docs/reference/components/pluginpreset.md Documents valueFrom.ref usage, syntax, and feature flags.
dev-env/dev.values.yaml Enables preset integration in dev values.
cmd/greenhouse/controllers.go Wires IsPresetIntegrationEnabled() into PluginPreset reconciler.
charts/manager/templates/manager/feature-flag.yaml Adds template docs + rendered value for preset integration flag.
charts/manager/templates/_helpers.tpl Adds helper for pluginPreset.integrationEnabled.
charts/greenhouse/values.yaml Adds default global.pluginPreset.integrationEnabled: false.
charts/greenhouse/ci/test-values.yaml Enables preset integration for chart CI values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +44 to 46
} else {
resolvedValues = util.ConvertToPluginOptionValues(preset.Spec.Plugin.OptionValues)
}
Comment on lines 38 to +56
if r.ExpressionEvaluationEnabled {
return r.resolveExpressionsForPreset(ctx, preset, cluster)
var err error
resolvedValues, err = r.resolveExpressionsForPreset(ctx, preset, cluster)
if err != nil {
return nil, fmt.Errorf("failed to resolve expressions: %w", err)
}
} else {
resolvedValues = util.ConvertToPluginOptionValues(preset.Spec.Plugin.OptionValues)
}

for _, ov := range preset.Spec.Plugin.OptionValues {
if ov.Expression != nil {
return nil, fmt.Errorf("option %s has expression but expressionEvaluationEnabled is disabled for PluginPreset controller", ov.Name)
if r.IntegrationEnabled {
var err error
resolvedValues, err = r.resolveReferencesForPreset(ctx, cluster, preset.Namespace, preset.Spec.Plugin.OptionValues, resolvedValues)
if err != nil {
return nil, fmt.Errorf("failed to resolve references: %w", err)
}
}

return util.ConvertToPluginOptionValues(preset.Spec.Plugin.OptionValues), nil
return resolvedValues, nil
Comment on lines +177 to +179
> :information_source: Expressions are only evaluated in PluginPresets.

> :warning: CEL expressions on standalone Plugins are deprecated and will be removed in a future release. Use PluginPresets for expression evaluation.
Comment on lines +345 to +352
#### New simplified syntax
```expression: spec.optionValues.filter(v, v.name == "my.value")[0].value```

#### With ${...} wrapper
```expression: ${spec.optionValues.filter(v, v.name == "my.value")[0].value}```

#### Legacy syntax (backward compatible)
```expression: object.spec.optionValues.filter(v, v.name == "my.value")[0].value```
k-fabryczny and others added 20 commits July 20, 2026 14:43
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
…esetToPluginOptionValues

Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
…, fix tests

Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
@k-fabryczny
k-fabryczny force-pushed the feat/v4-CEL-in-pp-1776 branch from 965b705 to 05fcb76 Compare July 20, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-apis documentation Improvements or additions to documentation feature helm-charts size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants