Skip to content

Welcome to Pulp Operator for devs

This is the section is designed to support contributions to Pulp Operator development.

Contributing guide

Pull Request Checklist

  1. Unless a change is small or doesn't affect users, create an issue on github.
  2. Add a changelog update.
  3. Write an excellent Commit Message. Make sure you reference and link to the issue.
  4. Push your branch to your fork and open a Pull request across forks.
  5. Add GitHub labels as appropriate.

Test the code

The tests can be run with the following command:

make test

If you want to run the tests inside your editor/IDE, you may need download the required binaries, you can do it by running:

make testbin

Test the Docs

Cross-platform:

pip install -r docs/doc_requirements.txt

Then:

mkdocs serve
Click the link it outputs. As you save changes to files modified in your editor, the browser will automatically show the new content.

Debug the code

  1. Ensure you have a cluster
    minikube start --vm-driver=docker --extra-config=apiserver.service-node-port-range=80-32000
    
  2. Build and apply the manifests
    make local
    
  3. Apply your custom resource
    kubectl apply -f config/samples/simple.yaml
    

The following steps are biased towards vscode:

  1. Make sure you have the Go extension installed
  2. Make sure you have a .vscode/launch.json file with at least this config:
      {
          "version": "0.2.0",
          "configurations": [
              {
              "name": "Launch Operator",
              "type": "go",
              "request": "launch",
              "mode": "auto",
              "program": "${workspaceFolder}",
              "args": [ "--zap-log-level=debug", "--zap-stacktrace-level=error" ]
              }
          ]
      }
    
    You can learn more about debugging settings here