This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ACS Fleet Manager is a Red Hat Advanced Cluster Security (ACS) managed service that allows users to request and manage ACS instances through the Red Hat Cloud Console. The service consists of two main components:
- Fleet Manager: Control plane service that accepts user requests and manages ACS instance provisioning
- Fleetshard-sync: Data plane component that provisions ACS instances on OpenShift clusters
# Build all binaries and generate OpenAPI
make all
# Build only binaries
make binary
# Generate code (OpenAPI, mocks, etc.)
make generate
# Clean build artifacts
make clean# Run unit tests
make test
# Run integration tests
make test/integration
# Run E2E tests
make test/e2e
# Run specific test with flags
make test TESTFLAGS="-run TestSomething"
# Run AWS integration tests
make test/aws# Setup local database
make db/setup
# Run database migrations
make db/migrate
# Teardown local database
make db/teardown
# Access database CLI
make db/login# Lint code
make lint
# Verify code (includes vet and OpenAPI validation)
make verify
# Check code formatting
make code/check
# Fix code formatting
make code/fix
# Validate OpenAPI specifications
make openapi/validate# Bootstrap development environment
make deploy/bootstrap
# Deploy to development cluster
make deploy/dev
# Fast redeploy for development
make deploy/dev-fast
# Reset E2E test environment
make test/e2e/reset# Build container image
make image/build
# Push image to registry
make image/push
# Build specific component images
make image/build/probe
make image/build/emailsender- Fleet Manager (
cmd/fleet-manager/) - Main control plane service - Fleetshard-sync (
fleetshard/) - Data plane synchronization service - Probe (
probe/) - Health check and monitoring service - Emailsender (
emailsender/) - Email notification service
internal/central/- Central service implementation (main business logic)pkg/- Shared packages and utilitiesopenapi/- OpenAPI specifications for all APIsdocs/- Documentation including architecture and development guidestemplates/- Kubernetes/OpenShift deployment templatesdev/env/- Development environment configuratione2e/- End-to-end test suites
The codebase follows a dependency injection pattern using the goava/di framework:
internal/central/providers.go- Main dependency injection configuration- Services are organized into:
- Services: Business logic (
internal/central/pkg/services/) - Workers: Background reconciliation (
internal/central/pkg/workers/) - Handlers: API endpoints (
internal/central/pkg/handlers/) - Presenters: Data transformation (
internal/central/pkg/presenters/)
- Services: Business logic (
- Uses PostgreSQL with GORM ORM
- Database migrations in
internal/central/pkg/migrations/ - Local development uses Docker container
- Unit tests: Standard Go testing with testify
- Integration tests: Test against real database and external services
- E2E tests: Use Ginkgo framework for comprehensive end-to-end scenarios
- AWS integration tests: Test cloud provider integrations
- Install prerequisites: Go 1.25+, Docker, Node.js, Java, OCM CLI
- Run
make setup/git/hooksto install pre-commit hooks - Use
make deploy/bootstrapto set up development cluster - Run
make deploy/devto start local development environment
- OpenAPI client/server code is generated - never edit generated files directly
- Run
make generateafter modifying OpenAPI specs or adding//go:generatedirectives - Generated files are in
internal/central/pkg/api/and other*_moq.gofiles
- golangci-lint for Go code quality
- shellcheck for shell scripts
- detect-secrets for security scanning
- Generated files verification
- Code formatting checks
- Environment-specific configs in
dev/config/ - Secret files in
secrets/directory (usemake secrets/touchto create empty files) - Multiple cluster types supported: minikube, kind, colima, CRC, OpenShift
- Always run
make lintandmake verifybefore committing - Database migrations are applied automatically on startup
- The service uses Red Hat SSO for authentication
- Multiple API specs: public, private, and admin APIs
- Container images are built for linux/amd64 platform
- Use
./scripts/fmcurlfor API testing - Fleet manager stores state in PostgreSQL, fleetshard-sync is stateless