The Linode Cloud Controller Manager development requires:
- A fairly up-to-date GNU tools environment
- Go 1.23 or higher
The simplest way to set up your development environment is using Devbox:
-
Install Devbox by following the instructions at jetpack.io/devbox/docs/installing_devbox/
-
Start the development environment:
devbox shell
This will automatically set up all required dependencies and tools for development.
- 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
go get github.com/linode/linode-cloud-controller-manager
cd $(go env GOPATH)/src/github.com/linode/linode-cloud-controller-manager
Use the following Make targets to build and run a local binary:
# Build the binary
make build
# Run the binary
make run
# You can also run the binary directly to pass additional args
dist/linode-cloud-controller-manager
To build and push a Docker image:
# Set the repo/image:tag with the TAG environment variable
# Then run the docker-build make target
IMG=linode/linode-cloud-controller-manager:canary make docker-build
# Push Image
IMG=linode/linode-cloud-controller-manager:canary make docker-push
To run the Docker image:
docker run -ti linode/linode-cloud-controller-manager:canary
The Linode Cloud Controller Manager uses Go Modules to manage dependencies.
To update or add dependencies:
go mod tidy
- Write correct, up-to-date, bug-free, fully functional, secure, and efficient code
- Use the latest stable version of Go
- Follow Go idioms and best practices
- Implement proper error handling with custom error types when beneficial
- Include comprehensive input validation
- Utilize built-in language features for performance optimization
- Follow relevant design patterns and principles
- Leave NO todos, placeholders, or incomplete implementations
- Include necessary imports and declarations
- Implement proper logging using appropriate logging mechanisms
- Consider implementing middleware or interceptors for cross-cutting concerns
- Structure code in a modular and maintainable way
- Use appropriate naming conventions and code organization
- Implement security best practices
- Consider rate limiting when appropriate
- Include authentication/authorization where needed
- Optimize for performance while maintaining readability
- Consider scalability in design decisions
- Provide brief comments for complex logic or language-specific idioms
- Include clear documentation for public interfaces
- Write tests using appropriate testing frameworks
- Document any assumptions or limitations
- Ensure your code follows the project's coding standards
- Update documentation as needed
- Add or update tests as appropriate
- Make sure all tests pass locally
- Submit the PR with a clear description of the changes
For development related questions or discussions, join us in #linode on the Kubernetes Slack.