Skip to content

Commit e2a2714

Browse files
committed
feat: update Function CRD to use packageRef instead of package field
1 parent 985bd76 commit e2a2714

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

operator/DEVELOPER.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,17 @@ is manually re-applied afterwards.
109109

110110
**NOTE:** Run `make help` for more information on all potential `make` targets
111111

112+
### CRD Updates
113+
114+
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/`.
115+
116+
To update the Helm chart CRD templates:
117+
118+
1. Update the CRD definitions in `operator/config/crd/bases/`
119+
2. Manually update the corresponding files in `operator/deploy/chart/templates/crd/` to match the base definitions
120+
3. Ensure any Helm-specific templating (like `{{- if .Values.crd.enable }}`) is preserved
121+
4. Test the changes to ensure the CRDs work correctly
122+
123+
**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.
124+
112125
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)

operator/deploy/chart/templates/crd/fs.functionstream.github.io_functions.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,18 @@ spec:
5959
module:
6060
description: Module name
6161
type: string
62-
package:
63-
description: Package name
64-
type: string
62+
packageRef:
63+
description: Package reference
64+
properties:
65+
name:
66+
description: Name of the Package resource
67+
type: string
68+
namespace:
69+
description: Namespace of the Package resource
70+
type: string
71+
required:
72+
- name
73+
type: object
6574
replicas:
6675
default: 1
6776
description: Number of replicas for the function deployment
@@ -113,7 +122,7 @@ spec:
113122
type: string
114123
required:
115124
- module
116-
- package
125+
- packageRef
117126
type: object
118127
status:
119128
description: FunctionStatus defines the observed state of Function

0 commit comments

Comments
 (0)