Skip to content

Commit 840a112

Browse files
Merge pull request #8 from NimbleBrainInc/bug/valueFrom
Fix: Add valueFrom support to extraEnv
2 parents a644fc4 + f0d34d4 commit 840a112

17 files changed

+2039
-11
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
mcp-operator: ${{ steps.changes.outputs.mcp-operator }}
1616
universal_adapter: ${{ steps.changes.outputs.universal_adapter }}
1717
rbac-controller: ${{ steps.changes.outputs.rbac-controller }}
18+
chart: ${{ steps.changes.outputs.chart }}
1819
steps:
1920
- uses: actions/checkout@v5
2021
- uses: dorny/paths-filter@v3
@@ -29,6 +30,9 @@ jobs:
2930
- 'universal-adapter/**'
3031
rbac-controller:
3132
- 'rbac-controller/**'
33+
chart:
34+
- 'chart/**'
35+
- 'scripts/test-chart.sh'
3236
3337
# Control Plane CI
3438
control-plane:
@@ -154,6 +158,35 @@ jobs:
154158
name: rbac-controller-coverage
155159
fail_ci_if_error: false
156160

161+
# Helm Chart CI
162+
helm-chart:
163+
runs-on: ubuntu-latest
164+
needs: changes
165+
if: needs.changes.outputs.chart == 'true'
166+
167+
steps:
168+
- uses: actions/checkout@v5
169+
170+
- name: Install Helm
171+
uses: azure/setup-helm@v4
172+
with:
173+
version: '3.13.0'
174+
175+
- name: Install helm-unittest plugin
176+
run: helm plugin install https://github.com/helm-unittest/helm-unittest
177+
178+
- name: Build chart dependencies
179+
run: helm dependency build chart/
180+
181+
- name: Run helm lint
182+
run: helm lint chart/
183+
184+
- name: Run helm unit tests
185+
run: helm unittest chart/
186+
187+
- name: Validate template rendering
188+
run: helm template test-release chart/ > /dev/null
189+
157190
# Docker builds
158191
docker-control-plane:
159192
runs-on: ubuntu-latest
@@ -221,6 +254,7 @@ jobs:
221254
mcp-operator,
222255
universal-adapter,
223256
rbac-controller,
257+
helm-chart,
224258
docker-control-plane,
225259
docker-mcp-operator,
226260
]
@@ -270,4 +304,12 @@ jobs:
270304
fi
271305
fi
272306
307+
# Helm chart checks
308+
if [[ "${{ needs.changes.outputs.chart }}" == "true" ]]; then
309+
if [[ "${{ needs.helm-chart.result }}" != "success" ]]; then
310+
echo "Helm chart CI failed"
311+
exit 1
312+
fi
313+
fi
314+
273315
echo "All applicable CI checks passed!"

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to NimbleTools Core will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.2] - 2025-10-12
9+
10+
### Fixed
11+
- Helm chart `extraEnv` now supports `valueFrom` for referencing Kubernetes secrets, ConfigMaps, and pod metadata
12+
- All three components (control-plane, operator, rbac-controller) now support standard Kubernetes secret management patterns
13+
- Chart.yaml now properly declares nginx-ingress as a dependency to fix helm lint warnings
14+
15+
### Added
16+
- Comprehensive Helm chart testing infrastructure using helm-unittest plugin
17+
- 18 automated tests covering extraEnv functionality across all components
18+
- `docs/HELM_CONFIGURATION.md` - Complete guide for Helm chart configuration with extraEnv examples
19+
- `docs/TESTING_HELM_CHARTS.md` - Guide for testing Helm charts using TDD principles
20+
- `scripts/test-chart.sh` - Automated test runner for chart validation
21+
- Makefile targets: `make test-chart`, `make verify-chart` for chart testing
22+
- Integration of chart tests into main `make verify` workflow
23+
- Chart.lock file to lock dependency versions
24+
25+
### Changed
26+
- Helm chart templates now conditionally render `value` or `valueFrom` based on configuration
27+
- Chart testing now runs as part of CI/CD verification process
28+
- CI now runs `helm dependency build` before linting to validate subcharts
29+
830
## [0.2.1] - 2025-10-08
931

1032
### Fixed

Makefile

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.PHONY: help install verify check clean docker-build update-version
33

44
# Version from VERSION file
5-
VERSION ?= 0.2.1
5+
VERSION ?= 0.2.2
66

77
# Default target
88
help: ## Show this help message
@@ -31,18 +31,35 @@ install-rbac-controller: ## Install rbac controller dependencies
3131
@cd rbac-controller && uv sync --dev
3232

3333
# Verification - single command for all quality checks
34-
verify: ## Run all verification steps (format, lint, type-check, test) in all modules
34+
verify: verify-code verify-chart ## Run all verification steps (code + chart tests)
35+
@echo ""
36+
@echo "✅ All modules verified successfully!"
37+
38+
verify-code: ## Run verification for all Python modules
3539
@echo "🔍 Running full verification suite for all modules..."
3640
@echo "================================================"
3741
@cd control-plane && $(MAKE) verify
3842
@cd mcp-operator && $(MAKE) verify
3943
@cd universal-adapter && $(MAKE) verify
4044
@cd rbac-controller && $(MAKE) verify
41-
@echo ""
42-
@echo "✅ All modules verified successfully!"
4345

4446

4547

48+
# Helm Chart Testing
49+
verify-chart: ## Run Helm chart unit tests
50+
@echo "🧪 Running Helm chart tests..."
51+
@./scripts/test-chart.sh
52+
53+
test-chart: verify-chart ## Alias for verify-chart
54+
55+
test-chart-verbose: ## Run Helm chart tests with verbose output
56+
@echo "🧪 Running Helm chart tests (verbose)..."
57+
@./scripts/test-chart.sh -v
58+
59+
lint-chart: ## Lint Helm chart
60+
@echo "🔍 Linting Helm chart..."
61+
@helm lint chart/
62+
4663
# Backwards compatibility alias
4764
check: verify ## Alias for verify (backwards compatibility)
4865

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.1
1+
0.2.2

chart/Chart.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: nginx-ingress
3+
repository: ""
4+
version: 0.1.0
5+
digest: sha256:198e7cd76693dd1510ea3db16346cbcf09b4d3f128da68272bb0b83905d345a5
6+
generated: "2025-10-13T20:06:34.187856-10:00"

chart/Chart.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
22
name: nimbletools-core
33
description: Open-source MCP service runtime for Kubernetes
4-
version: 0.2.1
5-
appVersion: "0.2.1"
4+
version: 0.2.2
5+
appVersion: "0.2.2"
66
home: https://www.nimbletools.ai
77
sources:
88
- https://github.com/nimblebrain/nimbletools-core
@@ -16,3 +16,7 @@ keywords:
1616
- kubernetes
1717
- serverless
1818
type: application
19+
dependencies:
20+
- name: nginx-ingress
21+
version: 0.1.0
22+
condition: nginx-ingress.enabled

chart/templates/control_plane.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ spec:
3838
value: {{ .Values.global.domain }}
3939
{{- range .Values.extraEnv }}
4040
- name: {{ .name }}
41+
{{- if .value }}
4142
value: {{ .value | quote }}
43+
{{- else if .valueFrom }}
44+
valueFrom:
45+
{{- toYaml .valueFrom | nindent 12 }}
46+
{{- end }}
4247
{{- end }}
4348
ports:
4449
- name: http

chart/templates/operator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ spec:
4242
value: "false"
4343
{{- range .Values.extraEnv }}
4444
- name: {{ .name }}
45+
{{- if .value }}
4546
value: {{ .value | quote }}
47+
{{- else if .valueFrom }}
48+
valueFrom:
49+
{{- toYaml .valueFrom | nindent 12 }}
50+
{{- end }}
4651
{{- end }}
4752
ports:
4853
- name: metrics

chart/templates/rbac-controller.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ spec:
100100
fieldPath: metadata.namespace
101101
{{- range .Values.extraEnv }}
102102
- name: {{ .name }}
103+
{{- if .value }}
103104
value: {{ .value | quote }}
105+
{{- else if .valueFrom }}
106+
valueFrom:
107+
{{- toYaml .valueFrom | nindent 12 }}
108+
{{- end }}
104109
{{- end }}
105110
resources:
106111
{{- toYaml .Values.rbacController.resources | nindent 10 }}

0 commit comments

Comments
 (0)