Skip to content

Latest commit

 

History

History
44 lines (26 loc) · 2.09 KB

File metadata and controls

44 lines (26 loc) · 2.09 KB

Developer Guidelines

Workflow, tooling, and day-to-day development procedures for tigera/operator. For code architecture and design principles, see principles.md.

Code structure

There are a few important packages to be aware of:

  • Operator API definitions exist in api/v1
  • Rendering code for generating Kubernetes resources is in pkg/render
  • Control/reconcile loops for each component can be found in pkg/controller/<component>
  • Status reporting is in pkg/controller/status

Tests:

  • Tests for file X.go can be found in X_test.go.
  • FV tests which run against a local cluster can be found in test/*.go.

API code

Code generation

  • Always run make gen-files after API or CRD changes. This regenerates CRD manifests, deepcopy methods, and client sets.
  • Don't edit generated files by hand. Files in pkg/components/ and pkg/imports/crds/ are regenerated by make targets. Edit the source configs instead.
  • After running gen-files, verify that existing resources weren't inadvertently changed to "Namespaced".

Controller dependency graph

This graph shows the dependencies between controllers. Optional dependencies are in dashed lines.

Controller Dependency Graph

Cherry-picks

When picking changes to a release branch, you must cherry-pick the change to all release branches semantically after the target release as well. This ensures that if a user upgrades their cluster, they do not "lose" features that existed in a prior release.

Common tasks

See common tasks for detailed information on common dev procedures like running the code, tests, and debugging.