4.0 KiB
Contributing
Issues, whether bugs, tasks, or feature requests are essential for keeping Polaris great. We believe it should be as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can keep on top of things.
Code of Conduct
This project adheres to a code of conduct. Please review this document before contributing to this project.
Sign the CLA
Before you can contribute, you will need to sign the Contributor License Agreement.
Project Structure
Polaris is built on top of controller-runtime. It can run in 3 different modes, a dashboard, a webhook, or a reporter that prints or exports validation results. All of these modes make use of the shared validator and config packages. Adding new validations is possible by only making additions to those packages.
Getting Started
We label issues with the "good first issue" tag if we believe they'll be a good starting point for new contributors. If you're interested in working on an issue, please start a conversation on that issue, and we can help answer any questions as they come up.
Setting Up Your Development Environment
Prerequisites
- A properly configured Golang environment with Go 1.11 or higher
- If you want to see the local changes you make on a Polaris dashboard, you will need access to a Kubernetes cluster defined in
~/.kube/config
Installation
- Install the project with
go get github.com/reactiveops/polaris - Change into the polaris directory which is installed at
$GOPATH/src/github.com/reactiveops/polaris - See the dashboard with
go run main.go --dashboard, then open http://localhost:8080/ - See the audit data
go run main.go --audit. This command shows the audit information on the command line.
Running Tests
The following commands are all required to pass as part of Polaris testing:
go list ./... | grep -v vendor | xargs golint -set_exit_status
go list ./... | grep -v vendor | xargs go vet
go test ./pkg/... -v -coverprofile cover.out
Creating a New Issue
If you've encountered an issue that is not already reported, please create an issue that contains the following:
- Clear description of the issue
- Steps to reproduce it
- Appropriate labels
Creating a Pull Request
Each new pull request should:
- Reference any related issues
- Add tests that show the issues have been solved
- Pass existing tests and linting
- Contain a clear indication of if they're ready for review or a work in progress
- Be up to date and/or rebased on the master branch
Creating a new release
Minor/patch releases
Minor and patch releases only need to change this repo. The Helm chart and deploy scripts will automatically pull in the latest changes.
To deploy a minor or patch release, follow steps 2 and 3 from "Major releases" below.
Major releases
Major releases need to change both this repository and the Helm chart repo.
The steps are:
- Create a PR in the charts repo
- Use a branch named
polaris-latest - Bump the version number in:
- stable/polaris/README.md
- stable/polaris/Chart.yaml
- stable/polaris/values.yaml
- Don't merge yet!
- Use a branch named
- Create a PR for this repo
- Bump the version number in:
- main.go
- README.md
- Update CHANGELOG.md
- Merge your PR
- Bump the version number in:
- Tag the latest branch for this repo
- Pull the latest for the
masterbranch - Run
git tag $VERSION && git push --tags - Wait for CircleCI to finish the build for the tag, which will:
- Create the proper image tag in quay.io
- Add an entry to the releases page on GitHub
- Pull the latest for the
- Merge the PR for the charts repo you created in step 1.