|
| 1 | +--- |
| 2 | +paths: ["charts/rhai-on-openshift-chart/**"] |
| 3 | +--- |
| 4 | +## rhai-on-openshift-chart (OCP/OLM-based) |
| 5 | + |
| 6 | +Template prefix: `rhoai-dependencies.` for all helpers. |
| 7 | + |
| 8 | +### Dependency templates |
| 9 | + |
| 10 | +Follow `templates/dependencies/cert-manager/operator.yaml` pattern: |
| 11 | +- `operator.yaml`: gate with `shouldInstall` + `isOlmMode`, call `rhoai-dependencies.operator.olm`. |
| 12 | +- `config.yaml` (optional): gate with `shouldInstall` + `crdExists`, render CR with `$dep.config.spec`. |
| 13 | +- Pass all OLM fields: `name`, `namespace`, `channel`, `version`, `targetNamespaces`, `config`, `root`. |
| 14 | + |
| 15 | +### Adding dependency |
| 16 | + |
| 17 | +1. Add to `values.yaml` under `dependencies.yourOperator` (enabled: auto, olm config, optional config/dependencies). |
| 18 | +2. Create `templates/dependencies/your-operator/operator.yaml` (and `config.yaml` if CR needed). |
| 19 | +3. Update `values.schema.json`. |
| 20 | +4. Run `make helm-docs`. |
| 21 | + |
| 22 | +### Adding component |
| 23 | + |
| 24 | +1. Add to `values.yaml` under `components.yourComponent` (dependencies, dsc, optional defaults per operator type). |
| 25 | +2. Add to `templates/operator/datasciencecluster.yaml` using `componentDSCConfig`. |
| 26 | +3. Add to `docs/examples/values-all-components-managed.yaml`. |
| 27 | +4. Update `values.schema.json`. |
| 28 | +5. Run `make helm-docs`. |
| 29 | + |
| 30 | +### Adding profile |
| 31 | + |
| 32 | +1. Create `profiles/<name>.yaml` — only override components/services that differ from default (Removed). |
| 33 | +2. Add name to `profile` enum in `values.schema.json`. |
| 34 | +3. Add snapshot entry in `scripts/snapshot-config.yaml`. |
| 35 | + |
| 36 | +### Key helpers (in `templates/definitions/`) |
| 37 | + |
| 38 | +- `shouldInstall`: tri-state (true/false/auto) → resolves via component/service/transitive deps. |
| 39 | +- `isOlmMode`: true when `tags.install-with-helm-dependencies` is false (default). |
| 40 | +- `crdExists`: checks CRD presence or `skipCrdCheck` flag. Use in config.yaml templates. |
| 41 | +- `componentDSCConfig`: merges user values > operator-type defaults > profile defaults. |
| 42 | +- `effectiveComponentManagementState` / `effectiveServiceManagementState`: resolves null states via profiles. |
| 43 | +- `operator.olm`: generates Namespace + OperatorGroup + Subscription. |
| 44 | + |
| 45 | +### Validation |
| 46 | + |
| 47 | +```bash |
| 48 | +make chart-snapshots CHART_NAME=rhai-on-openshift-chart |
| 49 | +make chart-test CHART_NAME=rhai-on-openshift-chart |
| 50 | +make helm-docs |
| 51 | +helm template ./charts/rhai-on-openshift-chart -f docs/examples/values-all-components-managed.yaml --set skipCrdCheck=true |
| 52 | +``` |
0 commit comments