Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Repository Orientation

The CAPG repository contains a number of sub-folders which allow us to organise different pieces of code and documentation into different areas. We largely follow Go conventions around project layout so it should be easy to navigate if you’re familiar with Go projects.

Modules and Dependencies

This repository uses Go Modules to track vendor dependencies.

To pin a new dependency:

  • Run go get <repository>@<version>
  • (Optional) Add a replace statement in go.mod

Makefile targets and scripts are offered to work with go modules:

  • make verify-modules checks whether go modules are out of date.
  • make modules runs go mod tidy to ensure proper vendoring.
  • hack/ensure-go.sh checks that the Go version and environment variables are properly set.

CI Jobs

Our CI configuration is split between jobs that run in Prow, and are configured in kubernetes/test-infra, and GitHub Actions which are configured in the .github directory.

Pull Request Checks

To see these tests in one place you can look at Testgrid.

Presubmits - Prow

In the table below … refers to cluster-api-provider-gcp.

JobWhenRunsWhat it doesMore Information
pull-…-testalways, requiredscripts/ci-test.shmake test-junit: unit and envtest integration tests, junit report* Unit Tests
* Integration Tests
* JUnit Report
pull-…-buildalways, requiredscripts/ci-build.shmake binaries: compiles the manager
pull-…-makealways, requiredrunner.sh scripts/ci-make.shmake docker-build: builds the controller image (docker-in-docker)
pull-…-verifyalways, requiredrunner.sh make verifygenerated files, modules, conversions, boilerplate, shellcheck, Tiltfile, go directive, doctoc
pull-…-e2e-testalways, requiredci-e2e.sh --flavor=unmanaged, GINKGO_FOCUS="Workload cluster creation"self-managed workload clusters on real GCP (Boskos project)* E2E Tests
pull-…-e2e-test-gkealways, requiredci-e2e.sh --flavor=gke, GINKGO_FOCUS="GKE workload cluster"managed (GKE) workload clusters* E2E Tests
pull-…-apidiffalways, optionalrunner.sh scripts/ci-apidiff.shmake apidiff against PULL_BASE_SHA
pull-…-conformancemanualci-conformance.shKubernetes conformance on a workload cluster* Conformance Tests
pull-…-conformance-ci-artifactsmanualci-conformance.sh, E2E_ARGS=-kubetest.use-ci-artifactssame, with Kubernetes CI artifacts* Conformance Tests
pull-…-capi-e2emanualci-e2e.sh --flavor=unmanaged, focus “Cluster API E2E tests”, skip [K8s-Upgrade] and API Version Upgradeupstream CAPI e2e suite* E2E Tests
pull-…-e2e-workload-upgrademanualci-e2e.sh --flavor=upgrade, focus [K8s-Upgrade]Kubernetes upgrade of a workload cluster* E2E Tests
pull-…-coveragemanualci-test-coverage.sh plus gopheragecoverage report* Coverage

To run any of the manual jobs comment /test <full job name> on a PR.

Presubmits - GitHub Actions

WorkflowTriggerDoes
Lint (lint.yml)every PRgolangci-lint
Codespellevery PRspelling over the tree, .codespellignore
Link-checkPRs touching docs/**; push to main touching docs/**markdown-link-check with .markdownlinkcheck.json
PR approve GH Workflowspull_request_target on PRs labelled ok-to-testapproves the pending Actions runs for them

Periodics

Some CAPG jobs run periodically, specifically we run build, test and conformance checks every 12h on our main branch and any actively maintained release branches.