Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
26a404a
feat(pluginpresets): evaluate CEL expressions for owned Plugins (#1774)
k-fabryczny Jun 1, 2026
c564332
Remove nolint:staticcheck
k-fabryczny Jun 1, 2026
442bff0
fix: remove backport workflow accidentally introduced during merge
k-fabryczny Jun 1, 2026
291ee61
fix pluginPreset doc
k-fabryczny Jun 3, 2026
a75caa4
Remove unsupported flag
k-fabryczny Jun 3, 2026
c3b08ef
clarify Plugin controller expression deprecation scope
k-fabryczny Jun 3, 2026
65ac595
Set expressionEvaluationEnabled to false for pluginPreset
k-fabryczny Jun 3, 2026
48e9ce5
Improve pluginPreset doc
k-fabryczny Jun 3, 2026
e9168cc
add RBAC permission for Teams required by expression evaluation
k-fabryczny Jun 3, 2026
3bb2004
Always resolve expression option values regardless of feature flag
k-fabryczny Jun 3, 2026
fda1740
Merge branch 'main' into feat/v2-CEL-in-pp
abhijith-darshan Jun 8, 2026
9078af2
Export BuildTemplateData and use it
k-fabryczny Jun 9, 2026
f09d2c7
Use PluginPresetPluginOptionValue in pluginPreset
k-fabryczny Jun 10, 2026
5a5b9e8
Automatic generation of CRD API Docs
cloud-operator-bot[bot] Jun 10, 2026
97e84fd
Add missing fields: Expression and ValueFrom
k-fabryczny Jun 10, 2026
a588f78
Update tests descriptions
k-fabryczny Jun 10, 2026
04c718a
Add nil guard for celResolver
k-fabryczny Jun 11, 2026
df4487d
Always call ResolveExpression
k-fabryczny Jun 11, 2026
241d0b4
Add Expression case to tests
k-fabryczny Jun 11, 2026
06047f0
feat(pluginpreset): resolve cross-preset ValueFrom.Ref references (#1…
k-fabryczny Jun 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/v1alpha1/pluginpreset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type PluginPresetPluginSpec struct {
DisplayName string `json:"displayName,omitempty"`

// Values are the values for a PluginDefinition instance.
OptionValues []PluginOptionValue `json:"optionValues,omitempty"`
OptionValues []PluginPresetPluginOptionValue `json:"optionValues,omitempty"`

// ReleaseNamespace is the namespace in the remote cluster to which the backend is deployed.
// Defaults to the Greenhouse managed namespace if not set.
Expand Down Expand Up @@ -114,8 +114,8 @@ type PluginPresetPluginValueFromSource struct {
// ClusterOptionOverride defines which plugin option should be override in which cluster
// +Optional
type ClusterOptionOverride struct {
ClusterName string `json:"clusterName"`
Overrides []PluginOptionValue `json:"overrides"`
ClusterName string `json:"clusterName"`
Overrides []PluginPresetPluginOptionValue `json:"overrides"`
}

const (
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions charts/greenhouse/ci/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ global:
expressionEvaluationEnabled: false
integrationEnabled: false
ociMirroringEnabled: false
# PluginPreset configuration for Greenhouse.
pluginPreset:
expressionEvaluationEnabled: true
integrationEnabled: true
linkerd_enabled: false
region: greenhouse
registry: ghcr.io/cloudoperators/greenhouse
Expand Down
4 changes: 4 additions & 0 deletions charts/greenhouse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ global:
expressionEvaluationEnabled: false
integrationEnabled: false
ociMirroringEnabled: false
# PluginPreset configuration for Greenhouse.
pluginPreset:
expressionEvaluationEnabled: true
integrationEnabled: true

postgresqlng:
enabled: true
Expand Down
3 changes: 3 additions & 0 deletions charts/manager/ci/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ global:
expressionEvaluationEnabled: false
integrationEnabled: false
ociMirroringEnabled: false
pluginPreset:
expressionEvaluationEnabled: true
integrationEnabled: true

controllerManager:
args:
Expand Down
34 changes: 12 additions & 22 deletions charts/manager/crds/greenhouse.sap_pluginpresets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ spec:
type: string
overrides:
items:
description: PluginOptionValue is the value for a PluginOption.
description: PluginPresetPluginOptionValue is the value for
a PluginOption.
properties:
expression:
description: |-
Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions.

Deprecated: Expression is deprecated on standalone Plugins and will be removed in a future release.
Consider using a PluginPreset to deploy Plugins utilizing the Expression field.
description: Expression is a YAML string with ${...} placeholders
that will be evaluated as CEL expressions.
type: string
name:
description: Name of the values.
Expand All @@ -87,11 +85,8 @@ spec:
description: ValueFrom references value in another source.
properties:
ref:
description: |-
Ref references values defined in another resource (Plugin, PluginPreset)

Deprecated: Ref is deprecated on standalone Plugins and will be removed in a future release.
Consider using a PluginPreset to deploy Plugins utilizing the Ref field.
description: Ref references values defined in another
resource (Plugin, PluginPreset)
properties:
expression:
description: Expression is a CEL expression to
Expand Down Expand Up @@ -307,14 +302,12 @@ spec:
optionValues:
description: Values are the values for a PluginDefinition instance.
items:
description: PluginOptionValue is the value for a PluginOption.
description: PluginPresetPluginOptionValue is the value for
a PluginOption.
properties:
expression:
description: |-
Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions.

Deprecated: Expression is deprecated on standalone Plugins and will be removed in a future release.
Consider using a PluginPreset to deploy Plugins utilizing the Expression field.
description: Expression is a YAML string with ${...} placeholders
that will be evaluated as CEL expressions.
type: string
name:
description: Name of the values.
Expand All @@ -326,11 +319,8 @@ spec:
description: ValueFrom references value in another source.
properties:
ref:
description: |-
Ref references values defined in another resource (Plugin, PluginPreset)

Deprecated: Ref is deprecated on standalone Plugins and will be removed in a future release.
Consider using a PluginPreset to deploy Plugins utilizing the Ref field.
description: Ref references values defined in another
resource (Plugin, PluginPreset)
properties:
expression:
description: Expression is a CEL expression to extract
Expand Down
8 changes: 8 additions & 0 deletions charts/manager/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,11 @@ Define postgresql helpers
{{- define "plugin.ociMirroringEnabled" -}}
{{- printf "%t" (required "global.plugin.ociMirroringEnabled missing" .Values.global.plugin.ociMirroringEnabled) }}
{{- end }}
{{/* Render the pluginPreset expression evaluation flag */}}
{{- define "pluginPreset.expressionEvaluationEnabled" -}}
{{- printf "%t" (required "global.pluginPreset.expressionEvaluationEnabled missing" .Values.global.pluginPreset.expressionEvaluationEnabled) }}
{{- end }}
{{/* Render the pluginPreset integration enabled flag */}}
{{- define "pluginPreset.integrationEnabled" -}}
{{- printf "%t" (required "global.pluginPreset.integrationEnabled missing" .Values.global.pluginPreset.integrationEnabled) }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/manager/templates/manager/feature-flag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,20 @@ data:
expressionEvaluationEnabled: false / true
integrationEnabled: false / true
ociMirroringEnabled: false / true
# enable pluginPreset features
# expressionEvaluationEnabled allows you to enable or disable CEL expression evaluation in PluginPreset
# when enabled, expressions in PluginPreset.spec.plugin.optionValues are evaluated before creating the Plugin
# integrationEnabled allows you to enable or disable ValueFrom.Ref resolution in PluginPreset
# when enabled, valueFrom.ref references in PluginPreset are resolved before creating the Plugin
pluginPreset: |
expressionEvaluationEnabled: false / true
Comment thread
k-fabryczny marked this conversation as resolved.
integrationEnabled: false / true
dex: |
storage: {{ include "dex.backend" $ }}
plugin: |
expressionEvaluationEnabled: {{ include "plugin.expressionEvaluationEnabled" $ }}
integrationEnabled: {{ include "plugin.integrationEnabled" $ }}
ociMirroringEnabled: {{ include "plugin.ociMirroringEnabled" $ }}
pluginPreset: |
expressionEvaluationEnabled: {{ include "pluginPreset.expressionEvaluationEnabled" $ }}
integrationEnabled: {{ include "pluginPreset.integrationEnabled" $ }}
9 changes: 8 additions & 1 deletion cmd/greenhouse/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var knownControllers = map[string]func(controllerName string, mgr ctrl.Manager)

// Plugin controllers.
"plugin": startPluginReconciler,
"pluginPreset": (&plugincontrollers.PluginPresetReconciler{}).SetupWithManager,
"pluginPreset": startPluginPresetReconciler,

"catalog": startCatalogReconciler,
"pluginDefinition": startPluginDefinitionReconciler,
Expand Down Expand Up @@ -93,6 +93,13 @@ func startPluginReconciler(name string, mgr ctrl.Manager) error {
}).SetupWithManager(name, mgr)
}

func startPluginPresetReconciler(name string, mgr ctrl.Manager) error {
return (&plugincontrollers.PluginPresetReconciler{
ExpressionEvaluationEnabled: featureFlags.IsPresetExpressionEvaluationEnabled(),
IntegrationEnabled: featureFlags.IsPresetIntegrationEnabled(),
}).SetupWithManager(name, mgr)
}

func startPluginDefinitionReconciler(name string, mgr ctrl.Manager) error {
return (&plugindefinitioncontroller.PluginDefinitionReconciler{
OCIMirroringEnabled: featureFlags.IsOCIMirroringEnabled(),
Expand Down
3 changes: 3 additions & 0 deletions dev-env/dev.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ global:
expressionEvaluationEnabled: true
integrationEnabled: true
ociMirroringEnabled: true
pluginPreset:
expressionEvaluationEnabled: true
integrationEnabled: true
alerts:
enabled: false
certManager:
Expand Down
15 changes: 9 additions & 6 deletions docs/reference/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,8 @@ <h3 id="greenhouse.sap/v1alpha1.ClusterOptionOverride">ClusterOptionOverride
<td>
<code>overrides</code><br>
<em>
<a href="#greenhouse.sap/v1alpha1.PluginOptionValue">
[]PluginOptionValue
<a href="#greenhouse.sap/v1alpha1.PluginPresetPluginOptionValue">
[]PluginPresetPluginOptionValue
</a>
</em>
</td>
Expand Down Expand Up @@ -3066,8 +3066,6 @@ <h3 id="greenhouse.sap/v1alpha1.PluginOptionValue">PluginOptionValue
</h3>
<p>
(<em>Appears on:</em>
<a href="#greenhouse.sap/v1alpha1.ClusterOptionOverride">ClusterOptionOverride</a>,
<a href="#greenhouse.sap/v1alpha1.PluginPresetPluginSpec">PluginPresetPluginSpec</a>,
<a href="#greenhouse.sap/v1alpha1.PluginSpec">PluginSpec</a>)
</p>
<p>PluginOptionValue is the value for a PluginOption.</p>
Expand Down Expand Up @@ -3260,6 +3258,11 @@ <h3 id="greenhouse.sap/v1alpha1.PluginPreset">PluginPreset
</div>
<h3 id="greenhouse.sap/v1alpha1.PluginPresetPluginOptionValue">PluginPresetPluginOptionValue
</h3>
<p>
(<em>Appears on:</em>
<a href="#greenhouse.sap/v1alpha1.ClusterOptionOverride">ClusterOptionOverride</a>,
<a href="#greenhouse.sap/v1alpha1.PluginPresetPluginSpec">PluginPresetPluginSpec</a>)
</p>
<p>PluginPresetPluginOptionValue is the value for a PluginOption.</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table">
Expand Down Expand Up @@ -3370,8 +3373,8 @@ <h3 id="greenhouse.sap/v1alpha1.PluginPresetPluginSpec">PluginPresetPluginSpec
<td>
<code>optionValues</code><br>
<em>
<a href="#greenhouse.sap/v1alpha1.PluginOptionValue">
[]PluginOptionValue
<a href="#greenhouse.sap/v1alpha1.PluginPresetPluginOptionValue">
[]PluginPresetPluginOptionValue
</a>
</em>
</td>
Expand Down
28 changes: 6 additions & 22 deletions docs/reference/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1105,14 +1105,10 @@ components:
type: string
overrides:
items:
description: PluginOptionValue is the value for a PluginOption.
description: PluginPresetPluginOptionValue is the value for a PluginOption.
properties:
expression:
description: |-
Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions.

Deprecated: Expression is deprecated on standalone Plugins and will be removed in a future release.
Consider using a PluginPreset to deploy Plugins utilizing the Expression field.
description: Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions.
type: string
name:
description: Name of the values.
Expand All @@ -1124,11 +1120,7 @@ components:
description: ValueFrom references value in another source.
properties:
ref:
description: |-
Ref references values defined in another resource (Plugin, PluginPreset)

Deprecated: Ref is deprecated on standalone Plugins and will be removed in a future release.
Consider using a PluginPreset to deploy Plugins utilizing the Ref field.
description: Ref references values defined in another resource (Plugin, PluginPreset)
properties:
expression:
description: Expression is a CEL expression to extract the value from the referenced resource
Expand Down Expand Up @@ -1327,14 +1319,10 @@ components:
optionValues:
description: Values are the values for a PluginDefinition instance.
items:
description: PluginOptionValue is the value for a PluginOption.
description: PluginPresetPluginOptionValue is the value for a PluginOption.
properties:
expression:
description: |-
Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions.

Deprecated: Expression is deprecated on standalone Plugins and will be removed in a future release.
Consider using a PluginPreset to deploy Plugins utilizing the Expression field.
description: Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions.
type: string
name:
description: Name of the values.
Expand All @@ -1346,11 +1334,7 @@ components:
description: ValueFrom references value in another source.
properties:
ref:
description: |-
Ref references values defined in another resource (Plugin, PluginPreset)

Deprecated: Ref is deprecated on standalone Plugins and will be removed in a future release.
Consider using a PluginPreset to deploy Plugins utilizing the Ref field.
description: Ref references values defined in another resource (Plugin, PluginPreset)
properties:
expression:
description: Expression is a CEL expression to extract the value from the referenced resource
Expand Down
Loading
Loading