Skip to content

Commit 4ad119b

Browse files
acm-agent[bot]claude
andcommitted
docs: unify README.md and CLAUDE.md via symlink
Merge the unique development content from CLAUDE.md (testing framework, code structure, important files, detailed build commands) into README.md, then replace CLAUDE.md with a symlink to README.md. Also add AGENTS.md symlink for Codex/other AI agent compatibility. This follows the agent context convention where README.md is the single source of truth and CLAUDE.md/AGENTS.md are symlinks to it. Signed-off-by: Xue Zhao <zxue@redhat.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: acm-agent[bot] <acm-agent@noreply.local>
1 parent c6b8e95 commit 4ad119b

3 files changed

Lines changed: 62 additions & 137 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README.md

CLAUDE.md

Lines changed: 0 additions & 128 deletions
This file was deleted.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README.md

README.md

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,33 +200,84 @@ kubectl logs -n cluster-permission-system deployment/cluster-permission-controll
200200

201201
## Development
202202

203-
### Building from Source
203+
### Building and Testing
204204

205205
```bash
206+
# Install CRDs to cluster
207+
make install
208+
209+
# Run controller locally (requires access to OCM hub cluster)
210+
make run
211+
206212
# Build the binary
207213
make build
208214

209-
# Build Docker image
210-
make docker-build
211-
212215
# Run tests
213216
make test
214217

215-
# Generate CRDs
216-
make manifests
218+
# Run end-to-end tests (deploys OCM first)
219+
make test-e2e
217220

218-
# Update generated code
219-
make generate
221+
# Build Docker image
222+
make docker-build
223+
224+
# Deploy to cluster
225+
make deploy
226+
227+
# Remove from cluster
228+
make undeploy
220229
```
221230

222231
### Code Generation
223232

224233
After modifying API types, regenerate code:
225234
```bash
226-
make generate
235+
# Generate manifests (CRDs, RBAC, etc.)
227236
make manifests
237+
238+
# Generate deepcopy methods and client code
239+
make generate
240+
241+
# Combined pre-build tasks (deps, manifests, generate, fmt, vet)
242+
make pre-build
243+
```
244+
245+
### Dependencies and Linting
246+
247+
```bash
248+
# Update Go dependencies
249+
make deps
250+
251+
# Format code
252+
make fmt
253+
254+
# Run go vet
255+
make vet
228256
```
229257

258+
### Testing Framework
259+
260+
- Uses Ginkgo/Gomega for testing
261+
- Controller tests in `controllers/clusterpermission_controller_test.go`
262+
- Test suite setup in `controllers/suite_test.go`
263+
- E2E tests in `e2e/` directory
264+
- Tests require OCM environment for full functionality
265+
266+
### Code Structure
267+
268+
- **API Types** (`api/v1alpha1/`): Follow Kubernetes API conventions with `+optional` markers. Condition types defined as constants.
269+
- **Controller** (`controllers/`): Standard controller-runtime reconciler pattern. Uses ManifestWork to deploy RBAC to managed clusters. Status conditions track reconciliation state.
270+
- **Generated Client** (`client/`): Auto-generated Kubernetes client code. Update with `make generate` after API changes.
271+
- **Configuration** (`config/`): Kubernetes manifests for CRDs, RBAC, and deployment.
272+
273+
### Important Files
274+
275+
- `main.go`: Controller manager entry point with scheme registration
276+
- `api/v1alpha1/clusterpermission_types.go`: Core API types and specifications
277+
- `controllers/clusterpermission_controller.go`: Main reconciliation logic
278+
- `controllers/helper.go`: Utility functions for manifest generation
279+
- `config/samples/`: Example ClusterPermission resources for testing
280+
230281
## Community and Support
231282

232283
### Contributing

0 commit comments

Comments
 (0)