Skip to content

Latest commit

 

History

History
79 lines (55 loc) · 3.8 KB

CONTRIBUTING.md

File metadata and controls

79 lines (55 loc) · 3.8 KB

Table of Contents generated with DocToc

Contributing guidelines

Terms

All contributions to the repository must be submitted under the terms of the Apache Public License 2.0.

Certificate of Origin

By contributing to this project, you agree to the Developer Certificate of Origin (DCO). This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution. See the DCO file for details.

Contributing a patch

  1. Submit an issue describing your proposed change to the repository in question. The repository owners will respond to your issue promptly.
  2. Fork the desired repository, then develop and test your code changes.
  3. Submit a pull request.

Issue and pull request management

Anyone can comment on issues and submit reviews for pull requests. In order to be assigned an issue or pull request, you can leave a /assign <your Github ID> comment on the issue or pull request (PR).

Pre-check before submitting a PR

Before submitting a PR, please perform the following steps:

  • List of steps to perform before submitting a PR.

After your PR is ready to commit, please run following commands to check your code.

make check
make test
make functional-test-full

PS: the file kustomization.yaml must have the namespace set to multicluster-engine. Same for servicemonitor.yaml and clusterrole_binding.yaml

Build images

Make sure your code build passed.

export BUILD_LOCALLY=1
make

Now, you can follow the getting started guide to work with this repository.

Add a new metric

  1. Update the pkg/options/collector.go DefaultCollectors varaible with your new metric name.
  2. Update the pkg/collectors/builder.go availableCollectors variable with your new metric name and create similar methods than buildManagedClusterInfoCollector
  3. Clone the pkg/collectors/managedclusterinfo.go to implement your metric and adapt it for your new metric.
  4. Create unit tests.
  5. Create functional tests.

Create a new project metrics

  1. Clone this project
  2. Update the pkg/options/collector.go DefaultCollectors varaible with your new metric name.
  3. Update the pkg/collectors/builder.go availableCollectors variable with your new metric name and rename methods buildManagedClusterInfoCollector*. If you have multiple metrics then creates similar methods and update the availableCollectors.
  4. Modify/rename the pkg/collectors/managedclusterinfo.go to implement your metric and adapt it for your new metric. The method getManagedClusterInfoMetricFamilies and implement your own business logic.
  5. Create unit tests.
  6. Create functianal tests.