Skip to content

Latest commit

 

History

History
120 lines (84 loc) · 3.14 KB

File metadata and controls

120 lines (84 loc) · 3.14 KB

Developing

Getting started

  1. Create a GitHub account
  2. Setup GitHub access via SSH
  3. Create and checkout a repo fork
  4. Set up your shell environment
  5. Install requirements
  6. Set up a Kubernetes cluster
  7. Running Tests

Then you can iterate.

Checkout your fork

The Go tools require that you clone the repository to the src/github.com/tektoncd/pruner directory in your GOPATH.

To check out this repository:

  1. Create your own fork of this repo
  2. Clone it to your machine:
mkdir -p ${GOPATH}/src/github.com/tektoncd
cd ${GOPATH}/src/github.com/tektoncd
git clone git@github.com:${YOUR_GITHUB_USERNAME}/pruner.git
cd tektoncd-pruner
git remote add upstream git@github.com:tektoncd/pruner.git
git remote set-url --push upstream no_push

Adding the upstream remote sets you up nicely for regularly syncing your fork.

Requirements

You must install these tools:

  1. go: The language Tekton Pruner is built in
  2. git: For source control
  3. kubectl (optional): For interacting with your kube cluster

Kubernetes cluster

To setup a Kubernetes cluster for development, see the Tekton Pipelines documentation.

Environment Setup

To build the Tekton Pruner project, you'll need to set GO111MODULE=on environment variable to force go to use go modules.

Iterating

Install Pruner

You can stand up a version of this controller on-cluster (to your kubectl config current-context):

ko apply -f config/

Observability Setup

For development with monitoring and metrics, use the observability setup script:

./hack/setup-observability-dev.sh

This sets up a Kind cluster with Tekton Pruner, Prometheus, and Jaeger. Access via:

Redeploy components

As you make changes to the code, you can redeploy components individually:

# Redeploy the controller
ko apply -f config/controller.yaml
# Redeploy the webhook
ko apply -f config/webhook.yaml

Tear it down

You can clean up everything with:

ko delete -f config/

Accessing logs

To look at the controller logs, run:

kubectl -n tekton-pipelines logs deployment/tekton-pruner-controller

Running Tests

Pruner uses the standard go testing framework. Unit tests can be run with:

TO BE UPDATED

Integration tests require a running cluster and Pruner to be installed. These are protected by a build tag "e2e". To run integration tests:

TO BE UPDATED