This guide explains how to set up your local development environment for the GitHub Secrets Operator.
The following tools are required:
- Docker
- VSCode with Go extension
- Homebrew (for macOS)
- Helm (for deployment)
All other tools will be installed automatically through VSCode tasks:
- Go 1.21 or later
- kubectl
- kind (Kubernetes in Docker)
- golangci-lint (for code linting)
To install all prerequisites:
- First, ensure Docker is installed and running
- Install VSCode Go extension
- Install Helm:
# macOS
brew install helm
# Linux
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash- Run the setup task:
# Using VSCode Command Palette (Cmd/Ctrl + Shift + P):
> Tasks: Run Task > Setup Development EnvironmentThis will install all required tools and set up your development environment.
The easiest way to get started is to use the combined task:
# Using VSCode Command Palette (Cmd/Ctrl + Shift + P):
> Tasks: Run Task > Start Development EnvironmentThis will:
- Install all required tools
- Create a local Kubernetes cluster
- Deploy the operator for testing
The following tasks are available in VSCode:
Setup Development Environment: Install all required toolsStart Development Environment: Create cluster and deploy operatorClean Development Environment: Clean up all resourcesRun Linter: Run code linting checks
To deploy the operator locally:
- Install CRDs:
make install- Deploy the operator:
make deployNote: If you make changes to the API (in api/v1alpha1/), you'll need to regenerate the CRDs:
make generate-crds
git add charts/github-actions-secrets-operator/crds/
git commit -m "Update CRDs"Sample resources are provided in config/samples/:
- Create a test secret:
kubectl apply -f config/samples/test-secret.yaml- Create a GithubActionSecretsSync resource:
kubectl apply -f config/samples/test-secretsync.yaml- Make code changes
- Run linter:
# Using VSCode Command Palette:
> Tasks: Run Task > Run Linter- Build and deploy:
make docker-build
make deploy- Test with sample resources
To clean up your development environment:
# Using VSCode Command Palette:
> Tasks: Run Task > Clean Development Environment- If the Kind cluster creation fails, ensure Docker is running and you have sufficient permissions.
- For debugging connection issues, check your KUBECONFIG is correctly pointing to the Kind cluster.