Skip to content

Latest commit

 

History

History
155 lines (103 loc) · 5.46 KB

CONTRIBUTING.md

File metadata and controls

155 lines (103 loc) · 5.46 KB

Contributing guidelines

Contributions

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.

DCO Sign Off

You must sign off your commit to state that you certify the DCO. To certify your commit for DCO, add a line like the following at the end of your commit message:

Signed-off-by: John Smith <john@example.com>

This can be done with the --signoff option to git commit. See the Git documentation for details.

Contributing A Patch

  1. Submit an issue describing your proposed change to the repo in question.
  2. The repo owners will respond to your issue promptly.
  3. Fork the desired repo, develop and test your changes (see Development and Testing)
  4. Submit a pull request.

Issues and Pull Request Management

Anyone may comment on issues and submit reviews for pull requests. However, in order to be assigned an issue or pull request, you must be a member of the stolostron GitHub organization.

Repo maintainers can assign you an issue or pull request by leaving a /assign <your Github ID> comment on the issue or pull request.

Pull Request Etiquette

Anyone may submit a pull request, although in order to ensure that the pull request can be responded to properly, link the associated issue in the PR. To have a pull request merged, it will require approval from a repository owner.

We request that all PRs which contribute new code into the repo also contain their associated unit and function tests.

Pre-check before submitting a PR

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

make test                   # Run unit tests

Build images

Make sure your code build passed.

make manifests              # Regenerate manifests if necessary

make docker-build           # Ensure build succeeds
# or
make podman-build

Development and Testing

Installing MultiClusterHub Operator with local code changes

This approach only tests MultiClusterHub Operator functionality (not the functionality of Open Cluster Management sub-components).

  1. Confirm the following are installed and configured on your local machine:

    • docker or podman
    • go (version 1.22.4 minimum)
    • python3
    • make
  2. oc login into an OCP cluster. See Requirements and recommendations for supported cluster sizes.

  3. Fork the multiclusterhub-operator GitHub repository

  4. Export the following environment variables:

export MOCK_IMAGE_REGISTRY=<some-public-image-repository>
export HUB_IMAGE_REGISTRY=<some-public-image-repository>

This environment variable correlate with the image you'll need to build and push to public image repositories:

  • HUB_IMAGE_REGISTRY correlates to the multiclusterhub-operator image, which is built from the multiclusterhub-operator codebase. The resulting image will be pushed to $HUB_IMAGE_REGISTRY/multiclusterhub-operator

These images are assumed to be public to eliminate any requirement for pull secrets.

  1. Run the following make commands to install the multiclusterhub-operator with a "mock" component image.
make prep-mock-install

... builds and pushes the mock image and preps the image manifest to use the freshly-built mock image

make mock-install

... builds and pushes the hub image, installs the multiclusterhub-operator as a deployment, and installs other required community-available operators

make mock-cr

... creates a legitimate MultiClusterHub Custom Resource. Note: In this Custom Resource, hub self-management is disabled (disableHubSelfManagement: true)

  1. Confirm "mock" installation successful by checking the mch Custom Resource for a Running status
oc get mch
  1. To uninstall all Hub components, run the following:
make uninstall
  1. To reinstall, run through these steps again.

Automated testing of local development code

  1. Run unit tests
make unit-tests