Skip to content

Commit 8377737

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents c47e419 + 0eef1ea commit 8377737

37 files changed

Lines changed: 18100 additions & 362 deletions

.github/workflows/rhai-on-xks-chart-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
printf '%s' "${RHAI_PULL_SECRET}" > "${PULL_SECRET_FILE}"
4949
make helm-install-verify-xks \
5050
XKS_CLOUD_PROVIDER=${{ matrix.cloud_provider }} \
51-
HELM_EXTRA_ARGS="--set-file imagePullSecret.dockerConfigJson=${PULL_SECRET_FILE}"
51+
XKS_PULL_SECRET="${PULL_SECRET_FILE}"
5252
5353
- name: Dump custom resources on failure
5454
if: failure()

.rules/helm-xks-chart.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,41 @@ Template prefix: `rhai-on-xks-chart.` for all helpers.
1111
- `templates/rbac/` — ServiceAccount, ClusterRole, ClusterRoleBinding.
1212
- `templates/crds/` — CRDs bundled in chart.
1313
- `templates/hooks/` — post-install Jobs (CRs creation, gateway setup).
14+
- `_crs-definitions.tpl`**single source of truth** for provider and component CR metadata; add new providers/CRs here only. All templates update automatically.
1415
- `templates/webhooks/` — MutatingWebhookConfiguration.
1516
- `templates/cloudmanager/{azure,coreweave}/` — cloud-specific resources (RBAC, CRDs, deployment).
1617
- `templates/pull-secret.yaml` — optional image pull secret.
1718
- `templates/validation.yaml` — calls `validateCloudProvider`.
1819

1920
### Cloud provider pattern
2021

21-
Exactly one of `azure.enabled` or `coreweave.enabled` must be true. Validated by `validateCloudProvider` helper.
22-
Cloud-specific templates gated with `{{- if .Values.<provider>.enabled }}`.
22+
Exactly one of `aws.enabled`, `azure.enabled`, or `coreweave.enabled` must be true. Validated by `validateCloudProvider` helper.
23+
Use `activeProvider | fromYaml` to access the active provider — avoid ranging over all providers or checking `.Values.<provider>.enabled` directly.
2324

24-
### Key helpers (`_helpers.tpl`)
25+
**To add a new provider:** add one entry to `providerRegistry` in `templates/hooks/_crs-definitions.tpl`. No other templates need changing.
26+
27+
### Component CR pattern
28+
29+
Component CRs (e.g. Kserve from `components.platform.opendatahub.io`) are created/deleted via post-install and pre-delete hook jobs.
30+
31+
**To add a new component CR:** add one entry to `componentCRRegistry` in `templates/hooks/_crs-definitions.tpl`. No other templates need changing.
32+
33+
### Key helpers
34+
35+
**`templates/_helpers.tpl`:**
2536

2637
- `validateCloudProvider`: fails if zero or multiple providers enabled.
27-
- `imagePullSecretEnabled`: checks `imagePullSecret.dockerConfigJson`.
28-
- `imagePullSecretName`: defaults to `rhai-pull-secret`.
29-
- `imagePullSecrets`: renders pod spec block.
38+
- `keResourceName`: returns plural KE resource name for the active provider.
39+
- `kubernetesEngineDependencyNamespaces`: collects namespaces from enabled provider KE dependencies.
40+
- `imagePullSecretEnabled` / `imagePullSecretName` / `imagePullSecrets`: image pull secret helpers.
41+
42+
**`templates/hooks/_crs-definitions.tpl`:**
43+
44+
- `providerRegistry` / `componentCRRegistry`: static YAML maps — CR kind, resource name (plural + singular), default CR name, API group.
45+
- `activeProvider`: returns YAML dict for the one enabled provider. Parse with `| fromYaml`. Fields: `name`, `keKind`, `keResource`, `keResourceSingular`, `keName`, `keEnabled` (bool), `keSpec`, `cloudManagerNamespace`. Returns empty map if no provider enabled.
46+
- `enabledProviderKECR`: returns `"true"` (truthy) or empty string when provider + KE are both enabled. Used as a boolean guard only — do not parse or inspect contents.
47+
- `enabledComponentCRs`: returns a JSON list of enabled component names. Parse with `fromJson` before use in guards (`if or $componentCRs $providerKECR`). Do not range over or access fields — use `crApplyCommands` / `crDeleteCommands` instead.
48+
- `crApplyCommands` / `crDeleteCommands`: emit kubectl apply/delete bash commands for all enabled CRs. Include with `| trimPrefix "\n" | nindent 14`.
3049

3150
### Image updates
3251

Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,19 +296,16 @@ XKS_CHART_PATH ?= $(CHARTS_DIR)/rhai-on-xks-chart
296296
XKS_RELEASE_NAME ?= rhai-on-xks
297297
XKS_NAMESPACE ?= rhai-on-xks
298298
XKS_CLOUD_PROVIDER ?= azure
299+
XKS_PULL_SECRET ?=
299300

300301
.PHONY: helm-verify-xks
301-
helm-verify-xks: ## Verify rhai-on-xks-chart installation
302-
RELEASE_NAME=$(XKS_RELEASE_NAME) NAMESPACE=$(XKS_NAMESPACE) CLOUD_PROVIDER=$(XKS_CLOUD_PROVIDER) ./charts/rhai-on-xks-chart/scripts/verify.sh
302+
helm-verify-xks: ## Verify rhai-on-xks-chart installation and lifecycle. Use XKS_TEST=<num> for specific test
303+
RELEASE_NAME="$(XKS_RELEASE_NAME)" NAMESPACE="$(XKS_NAMESPACE)" CLOUD_PROVIDER="$(XKS_CLOUD_PROVIDER)" PULL_SECRET="$(XKS_PULL_SECRET)" HELM_EXTRA_ARGS="$(HELM_EXTRA_ARGS)" bash ./charts/rhai-on-xks-chart/scripts/verify.sh $(XKS_TEST)
303304

304305
.PHONY: helm-install-verify-xks
305306
helm-install-verify-xks: ## Install and verify rhai-on-xks-chart
306-
@echo "=== Step 1: Install rhai-on-xks-chart ==="
307307
# TODO(RHOAIENG-63729): remove -f values-e2e.yaml once a runner with sufficient resources is available
308-
helm upgrade --install $(XKS_RELEASE_NAME) ./$(XKS_CHART_PATH) -n $(XKS_NAMESPACE) --create-namespace --set $(XKS_CLOUD_PROVIDER).enabled=true -f $(XKS_CHART_PATH)/test/values-e2e.yaml $(HELM_EXTRA_ARGS)
309-
@echo ""
310-
@echo "=== Step 2: Verify installation ==="
311-
$(MAKE) helm-verify-xks
308+
VALUES_FILE=$(XKS_CHART_PATH)/test/values-e2e.yaml $(MAKE) helm-verify-xks
312309

313310
.PHONY: helm-uninstall
314311
helm-uninstall: ## Uninstall helm chart and all dependencies

charts/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ apiVersion: sailoperator.io/v1
174174
kind: Istio
175175
metadata:
176176
name: default
177-
namespace: istio-system
178177
spec:
179178
namespace: istio-system
180179
version: v1.27-latest

charts/dependencies/sail-operator/templates/istio.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: sailoperator.io/v1
22
kind: Istio
33
metadata:
44
name: default
5-
namespace: {{ .Values.namespace }}
65
spec:
76
namespace: {{ .Values.namespace }}
87
version: v1.27-latest

charts/dependencies/sail-operator/test/snapshots/default.snap.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ apiVersion: sailoperator.io/v1
563563
kind: Istio
564564
metadata:
565565
name: default
566-
namespace: istio-system
567566
spec:
568567
namespace: istio-system
569568
version: v1.27-latest

charts/rhai-on-xks-chart/api-docs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,5 @@ RHAI on XKS Helm chart for non-OLM installation on non-OpenShift Kubernetes serv
9898
| rhaiOperator.resources.limits.memory | string | `"1Gi"` | |
9999
| rhaiOperator.resources.requests.cpu | string | `"300m"` | |
100100
| rhaiOperator.resources.requests.memory | string | `"256Mi"` | |
101+
| uninstall.cleanupNamespaces | bool | `false` | |
101102

0 commit comments

Comments
 (0)