Development
August 18, 2023 ยท View on GitHub
Get the sources
git clone https://github.com/goharbor/harbor-operator.git
cd harbor-operator
You developed a new cool feature? Fixed an annoying bug? We would be happy to hear from you!
Have a look in CONTRIBUTING.md
Dependencies
Packages
Install dev tools with:
make dev-tools
Services
-
Kubernetes cluster. You can order a Kubernetes cluster on ovh.com. Then configure your environment to have the right
Kubeconfig. -
Jaeger server.
docker-compose up -d
Kubernetes resources
make install-dependencies # This will install Helm charts in your current cluster
make install # Install Custom Resource Definition
Configuration
Generate resources using make generate
Run it
export CONFIGURATION_FROM="file:$(pwd)/config-dev.yml"
make run
Deploy a harbor instance
export LBAAS_DOMAIN=$(kubectl get svc nginx-nginx-ingress-controller -o jsonpath={.status.loadBalancer.ingress[0].hostname})
export CORE_DATABASE_SECRET=$(kubectl get secret core-database-postgresql -o jsonpath={.data.postgresql-password} | base64 --decode)
export CLAIR_DATABASE_SECRET=$(kubectl get secret clair-database-postgresql -o jsonpath={.data.postgresql-password} | base64 --decode)
export NOTARY_SERVER_DATABASE_SECRET=$(kubectl get secret notary-server-database-postgresql -o jsonpath={.data.postgresql-password} | base64 --decode)
export NOTARY_SIGNER_DATABASE_SECRET=$(kubectl get secret notary-signer-database-postgresql -o jsonpath={.data.postgresql-password} | base64 --decode)
kubectl kustomize config/samples | gomplate | kubectl apply -f -
cat <<EOF
Admin password: $(kubectl get secret admin-password-secret -o jsonpath={.data.password} | base64 --decode)
EOF
Linters
make lint
Tests
Warning: Some resource may not be deleted if a test fails
-
Export
KUBECONFIGvariable:export KUBECONFIG=/path/to/kubeconfig export USE_EXISTING_CLUSTER=true -
make test