Skip to content

Latest commit

 

History

History
92 lines (63 loc) · 2.51 KB

development.md

File metadata and controls

92 lines (63 loc) · 2.51 KB

Development

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 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

  1. Export KUBECONFIG variable:

    export KUBECONFIG=/path/to/kubeconfig
    export USE_EXISTING_CLUSTER=true
  2. make test