From e2a2714903677db1be222c2ddb230bc7648240fd Mon Sep 17 00:00:00 2001 From: EvanWave Date: Mon, 21 Jul 2025 22:48:51 +0800 Subject: [PATCH] feat: update Function CRD to use packageRef instead of package field --- operator/DEVELOPER.md | 13 +++++++++++++ .../fs.functionstream.github.io_functions.yaml | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/operator/DEVELOPER.md b/operator/DEVELOPER.md index 2caee21..0614924 100644 --- a/operator/DEVELOPER.md +++ b/operator/DEVELOPER.md @@ -109,4 +109,17 @@ is manually re-applied afterwards. **NOTE:** Run `make help` for more information on all potential `make` targets +### CRD Updates + +When CRD definitions are updated in `operator/config/crd/bases/`, you need to ensure the Helm chart CRD templates are also updated to match. The Helm chart CRD templates are located in `operator/deploy/chart/templates/crd/`. + +To update the Helm chart CRD templates: + +1. Update the CRD definitions in `operator/config/crd/bases/` +2. Manually update the corresponding files in `operator/deploy/chart/templates/crd/` to match the base definitions +3. Ensure any Helm-specific templating (like `{{- if .Values.crd.enable }}`) is preserved +4. Test the changes to ensure the CRDs work correctly + +**Important:** The Helm chart CRD templates should always reflect the latest changes from the base CRD definitions to ensure consistency between direct CRD installation and Helm chart installation. + More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) \ No newline at end of file diff --git a/operator/deploy/chart/templates/crd/fs.functionstream.github.io_functions.yaml b/operator/deploy/chart/templates/crd/fs.functionstream.github.io_functions.yaml index 66ff59b..d5795e7 100755 --- a/operator/deploy/chart/templates/crd/fs.functionstream.github.io_functions.yaml +++ b/operator/deploy/chart/templates/crd/fs.functionstream.github.io_functions.yaml @@ -59,9 +59,18 @@ spec: module: description: Module name type: string - package: - description: Package name - type: string + packageRef: + description: Package reference + properties: + name: + description: Name of the Package resource + type: string + namespace: + description: Namespace of the Package resource + type: string + required: + - name + type: object replicas: default: 1 description: Number of replicas for the function deployment @@ -113,7 +122,7 @@ spec: type: string required: - module - - package + - packageRef type: object status: description: FunctionStatus defines the observed state of Function