Skip to content

Conversation

@abhijith-darshan
Copy link
Contributor

@abhijith-darshan abhijith-darshan commented Nov 13, 2025

Description

when overrides for options are spec'd, Catalog controller can prepare Kustomize patches to override PluginDefinition option's default value matched by its name.

Catalog controller does this by extracting the archive of the PluginDefinition manifests resolved by flux GitRepository and resource composition from ArtifactGenerator. The archive URL is available in a referencing Kind ExternalArtifact which is fed as a source for flux Kustomization.

Catalog controller also saves the archive of external artifact to a tmp location, to avoid archive fetches from source-watcher for repeated reconciliations and the digest hasn't changed.

Example

apiVersion: greenhouse.sap/v1alpha1
kind: Catalog
metadata:
  name: greenhouse-extensions
  namespace: greenhouse
spec:
  sources:
    - ref:
        branch: main
      repository: https://github.com/cloudoperators/greenhouse-extensions
      resources:
        - cert-manager/plugindefinition.yaml
        - ingress-nginx/plugindefinition.yaml
        - kube-monitoring/plugindefinition.yaml
      overrides:
        - name: cert-manager
          alias: cert-manager-overridden
          optionsOverride:
            - name: "cert-manager.installCRDs"
              value: true
            - name: cert-manager.webhook.timeoutSeconds
              value: 15
    - ref:
        sha: ed3ff23bca21eef6cffc0956df338d8185340fc5
      repository: https://github.com/cloudoperators/greenhouse-extensions
      resources:
        - perses/plugindefinition.yaml
      overrides:
        - name: perses
          alias: perses-overridden
          optionsOverride:
            - name: "perses.serviceMonitor.selector.matchLabels"
              value:
                foo: bar
                baz: qux

If an option is overridden, then the description of the option is modified to contain (overridden by Catalog) at the end.

$ kc get pd cert-manager-overridden -n greenhouse -o yaml | yq '.spec.options[] | select(.description | match("(?i)overridden"))'

default: true
description: Whether to install CRDs (overridden by Catalog)
name: cert-manager.installCRDs
required: false
type: bool
default: false
description: Whether to enable Prometheus metrics (overridden by Catalog)
name: cert-manager.prometheus.enabled
required: false
type: bool
default: letsencrypt-prod
description: Name of the cert-manager issuer to use for TLS certificates (overridden by Catalog)
displayName: Enable certificate owner reference
name: cert-manager.ingressShim.defaultIssuerName
required: false
type: string
default: 15
description: Timeout in seconds for the CertManager webhook (overridden by Catalog)
name: cert-manager.webhook.timeoutSeconds
required: false
type: int

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

Added tests?

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

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

@abhijith-darshan
Copy link
Contributor Author

needs #1597 to be merged for writing e2e Kustomize patch scenarios for optionsOverride

@abhijith-darshan abhijith-darshan marked this pull request as ready for review November 13, 2025 01:38
@abhijith-darshan abhijith-darshan requested review from a team as code owners November 13, 2025 01:38
@abhijith-darshan abhijith-darshan force-pushed the feat/cat_option_override branch 3 times, most recently from 1b264f6 to 6c607ab Compare November 14, 2025 10:37
IvoGoman
IvoGoman previously approved these changes Nov 14, 2025
@abhijith-darshan
Copy link
Contributor Author

needs cloudoperators/common#49 to fix the change in shared e2e workflow

@abhijith-darshan abhijith-darshan force-pushed the feat/cat_option_override branch 3 times, most recently from 5680250 to c63b20c Compare November 17, 2025 14:51
@abhijith-darshan abhijith-darshan marked this pull request as draft November 19, 2025 09:56
@abhijith-darshan abhijith-darshan marked this pull request as ready for review November 19, 2025 11:24
@abhijith-darshan abhijith-darshan force-pushed the feat/cat_option_override branch 5 times, most recently from a041cb2 to 6df99a4 Compare November 25, 2025 17:46
IvoGoman
IvoGoman previously approved these changes Nov 28, 2025
IvoGoman
IvoGoman previously approved these changes Nov 28, 2025
when specified, catalog can prepare kustomize patches to override pluginDefinition option's default value matched by its name. Catalog controller also saves the archive of external artifact to a tmp location for repeated reconciliations and avoids fetches from source-watcher if the archive digest hasn't changed.

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): generate open api docs

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): tidy up!

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): add artifact fetch retries flag and remove ext artifact watch

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): propagate retries to artifactory

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): remove os read file helper

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): allow scenario to be initialized without a testData yaml

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): adds catalog options override e2e scenario.

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): local flux setup network policy

This policy allows greenhouse controller manager to fetch artifacts from source-watcher

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): test e2e setup

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): use the fix from common e2e workflow

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): add pod selector to netpol

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): use new context for artifact fetcher with 15s timeout

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): flux netpol combine podSelector with namespaceSelector

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): apply review suggestions

Co-authored-by: IvoGoman <ivo.gosemann@sap.com>

(chore): re-use helper from test pkg

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): update readme

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): fix var name

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): fix fmt

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): force flux to reconcile faster in e2e

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): return err if option not found for overrides

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): extend manifest extraction with name filtering and local resource builder

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>

(chore): use helm manifest pkg to extract (C)PD

Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>
@abhijith-darshan abhijith-darshan merged commit 9cbc427 into main Nov 28, 2025
23 checks passed
@abhijith-darshan abhijith-darshan deleted the feat/cat_option_override branch November 28, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] - Catalog supports defaults for PluginDefinitions

3 participants