Table of Contents generated with DocToc
All contributions to the repository must be submitted under the terms of the Apache Public License 2.0.
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.
- Submit an issue describing your proposed change to the repository in question. The repository owners will respond to your issue promptly.
- Fork the desired repository, then develop and test your code changes.
- Submit a pull request.
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).
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
Make sure your code build passed.
export BUILD_LOCALLY=1
make
Now, you can follow the getting started guide to work with this repository.
- Update the pkg/options/collector.go
DefaultCollectors
varaible with your new metric name. - Update the pkg/collectors/builder.go
availableCollectors
variable with your new metric name and create similar methods thanbuildManagedClusterInfoCollector
- Clone the pkg/collectors/managedclusterinfo.go to implement your metric and adapt it for your new metric.
- Create unit tests.
- Create functional tests.
- Clone this project
- Update the pkg/options/collector.go
DefaultCollectors
varaible with your new metric name. - Update the pkg/collectors/builder.go
availableCollectors
variable with your new metric name and rename methodsbuildManagedClusterInfoCollector*
. If you have multiple metrics then creates similar methods and update theavailableCollectors
. - 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. - Create unit tests.
- Create functianal tests.