linode-cloud-controller-manager

Development Guide

Prerequisites

The Linode Cloud Controller Manager development requires:

Setting Up Development Environment

The simplest way to set up your development environment is using mise:

  1. Install mise by following the instructions at mise.jdx.dev

  2. Install the pinned toolchain from the repository root:

mise install
  1. Run commands through mise so the pinned toolchain is used:
mise run build
mise run test

This will automatically set up all required dependencies and tools for development.

Option 2: Manual Setup

  1. If you haven't set up a Go development environment, follow these instructions to install Go.

On macOS, you can use Homebrew:

brew install golang

Getting Started

Download Source

go get github.com/linode/linode-cloud-controller-manager
cd $(go env GOPATH)/src/github.com/linode/linode-cloud-controller-manager

Building the Project

Build Binary

Use the following mise tasks to build and run a local binary:

# Build the binary
mise run build

# Run the binary
mise run run

# You can also run the binary directly to pass additional args
dist/linode-cloud-controller-manager

Building Container Images

The local image build task loads the built image into your local Docker-compatible daemon.

To build and push an image with ko:

# Build locally into your Docker-compatible daemon
IMAGE_TAGS=canary mise run ko-build

# Publish Image
KO_DOCKER_REPO=docker.io/linode/linode-cloud-controller-manager IMAGE_TAGS=canary mise run ko-publish

To run the locally built image after ko-build:

docker run -ti ko.local/github.com/linode/linode-cloud-controller-manager:canary

Managing Dependencies

The Linode Cloud Controller Manager uses Go Modules to manage dependencies.

To update or add dependencies:

go mod tidy

Development Guidelines

Code Quality Standards

Code Structure

Security & Performance

Documentation & Testing

Pull Request Process

  1. Ensure your code follows the project's coding standards
  2. Update documentation as needed
  3. Add or update tests as appropriate
  4. Make sure all tests pass locally
  5. Submit the PR with a clear description of the changes

Getting Help

For development related questions or discussions, join us in #linode on the Kubernetes Slack.