Skip to content

Commit 1ce7151

Browse files
Fix CI workflows and refine README
lint: remove redundant gofmt and go vet steps; let .golangci.yml drive linter config instead of overriding via --enable flags in action args test: remove redundant go vet step (make test already runs it) test-e2e: restrict trigger to push on main + workflow_dispatch (was running on every push/PR); remove TESTARGS which had no effect since the Makefile test-e2e target does not reference that variable README: controller best practices list, diagram fix, endpoint table fix, Go version, capabilities section replacing version changelog Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ef286ab commit 1ce7151

4 files changed

Lines changed: 30 additions & 46 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,7 @@ jobs:
2222
- name: Download dependencies
2323
run: go mod download
2424

25-
- name: Verify formatting
26-
run: |
27-
if [ "$(gofmt -l .)" != "" ]; then
28-
echo "Code is not formatted:"
29-
gofmt -l .
30-
exit 1
31-
fi
32-
33-
- name: Run go vet
34-
run: go vet ./...
35-
3625
- name: Run golangci-lint
3726
uses: golangci/golangci-lint-action@v8
3827
with:
39-
args: --timeout=5m --enable=govet --enable=staticcheck --enable=ineffassign --enable=unused
28+
args: --timeout=5m

.github/workflows/test-e2e.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: E2E Tests
22

33
on:
44
push:
5-
pull_request:
5+
branches: [main]
6+
workflow_dispatch:
67

78
jobs:
89
test-e2e:
@@ -31,4 +32,4 @@ jobs:
3132
- name: Run E2E tests
3233
run: |
3334
go mod tidy
34-
make test-e2e TESTARGS="-ginkgo.skip='metrics endpoint'"
35+
make test-e2e

.github/workflows/test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,5 @@ jobs:
2222
- name: Download dependencies
2323
run: go mod download
2424

25-
- name: Run go vet
26-
run: go vet ./...
27-
2825
- name: Run tests
2926
run: make test

README.md

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ The controller continuously reconciles the desired state into:
2424
- A Kubernetes **Service**
2525
- A Kubernetes **HorizontalPodAutoscaler** (when autoscaling is enabled)
2626

27+
It follows Kubernetes controller best practices:
28+
29+
- Idempotent reconciliation — safe to run repeatedly
30+
- Drift detection — updates owned resources when spec changes
31+
- HPA-safe replica management — never overwrites replicas managed by autoscaler
32+
- Conflict-safe status updates via retry-on-conflict
33+
- Owner references — child resources are garbage-collected when the CR is deleted
34+
2735
---
2836

2937
## Architecture
@@ -44,11 +52,9 @@ The controller continuously reconciles the desired state into:
4452
▼ ▼ ▼
4553
Deployment Service HPA
4654
47-
48-
Status Propagation
49-
50-
51-
Prometheus Metrics
55+
┌────────────┘
56+
57+
Status Propagation → Prometheus Metrics
5258
```
5359

5460
The controller:
@@ -89,7 +95,7 @@ spec:
8995
targetCPUUtilization: 60
9096
```
9197
92-
### Field behaviour
98+
### Field behavior
9399
94100
| Field | Default | Notes |
95101
|-------|---------|-------|
@@ -167,9 +173,9 @@ The project includes an HTTP tool server that exposes infrastructure operations
167173

168174
| Endpoint | Method | Description |
169175
|----------|--------|-------------|
170-
| `POST /tools` | POST | Invoke a tool by name |
171-
| `GET /tools/list` | GET | List available tools |
172-
| `POST /agent` | POST | Natural language interface |
176+
| `/tools` | POST | Invoke a tool by name |
177+
| `/tools/list` | GET | List available tools |
178+
| `/agent` | POST | Natural language interface |
173179

174180
**Available tools:**
175181

@@ -275,7 +281,7 @@ SUCCESS! -- 11 Passed | 0 Failed | 0 Pending | 0 Skipped
275281

276282
## Local Development
277283

278-
**Prerequisites:** Go 1.21+, kubectl, a running Kubernetes cluster (kind works well)
284+
**Prerequisites:** Go 1.25+, kubectl, a running Kubernetes cluster (kind works well)
279285

280286
```bash
281287
# Install CRD into cluster
@@ -302,24 +308,15 @@ go run ./mcp
302308

303309
---
304310

305-
## Features
306-
307-
### v0.1
308-
- Custom CRD with OpenAPI schema validation
309-
- Deployment and Service reconciliation with drift detection
310-
- Immutable-field-safe update logic
311-
- Status conditions propagated from underlying Deployment
312-
- Controller-runtime architecture with owner references
313-
314-
### v0.2
315-
- HorizontalPodAutoscaler integration
316-
- HPA-safe replica management
317-
- Conflict-safe status updates via retry-on-conflict
318-
- Prometheus metrics — reconciliation and business-level
311+
## Capabilities
319312

320-
### v1.0
313+
- Custom CRD (`AIDeployment`) with OpenAPI schema validation
314+
- Deployment, Service, and HPA reconciliation with drift detection
315+
- Idempotent, conflict-safe controller following Kubernetes best practices
316+
- HPA integration with stabilization windows tuned for AI workloads
317+
- Status conditions propagated from underlying Deployment readiness
318+
- Prometheus metrics for reconciliation health and business state
321319
- `aictl` CLI for direct cluster management
322-
- HTTP tool server with 5 model lifecycle tools
323-
- Natural language agent endpoint
324-
- `spec.image`, `spec.port`, and `spec.serviceType` fields fully reconciled
325-
- Context propagation and safe error handling throughout tool server
320+
- HTTP tool server exposing 5 model lifecycle operations
321+
- Natural language agent endpoint backed by keyword-based intent parsing
322+
- Owner references for automatic garbage collection of child resources

0 commit comments

Comments
 (0)