Skip to content

Latest commit

 

History

History
68 lines (48 loc) · 3.04 KB

CONTRIBUTING.md

File metadata and controls

68 lines (48 loc) · 3.04 KB

Contributing Guidelines

Welcome to Kubernetes. We are excited about the prospect of you joining our community! The Kubernetes community abides by the CNCF code of conduct. Here is an excerpt:

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

Getting Started

We have full documentation on how to get started contributing here:

Mentorship

  • Mentoring Initiatives - We have a diverse set of mentorship programs available that are always looking for volunteers!

Contact Information

Setup a Dev Environment

  • install go
  • export GO111MODULE=on
  • install wire

Build and Test

  1. go generate
  • Generates the wire_gen.go files
  1. go test ./...
  • Test the
  1. golint -min_confidence 0.9 ./...
  • Look for errors
  1. go build
  • Build the binary

Dependency Injection

This repo uses Dependency Injection for wiring together the Commands. See the wire tutorial for more on DI.

Adding a Command

  1. Add a new package for your cobra command under cmd/
  • e.g. kubectl apply status would be added under cmd/apply/status
  • Add it to the parent command
  • Copy an existing command as an example
  1. Add a new package that contains the library for your command under internal/pkg
  • e.g. kubectl apply status library would be added under internal/pkg/status
  • Invoke it from the command you added
  • Copy an existing package as an example
  1. Add the DI wiring for your library
  • Edit internal/pkg/wiring/wiring.go - Add your struct to the ProviderSet list
  • Edit internal/pkg/wiring/wire.go - Add an Initialize function for you struct

Adding a Library (non-internal)

  1. Add a new package for your library under pkg
  2. Add a new package that contains the implementation under internal/pkg
  • Invoke it from your public package