Skip to content

Commit

Permalink
Merge pull request #162 from pwittrock/docs-gen
Browse files Browse the repository at this point in the history
Add section on boilerplate to the docs.
  • Loading branch information
droot committed May 15, 2018
2 parents e0be45e + ca0b5ef commit 5ba5473
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
### Beyond the Basics

* Development Workflow
* [Defining Boilerplate License Headers](beyond_basics/boilerplate.md)
* [Running Tests](beyond_basics/running_tests.md)
* [Generating API Documentation](beyond_basics/generating_documentation.md)
* [Updating Kubebuilder](beyond_basics/upgrading_kubebuilder.md)
Expand Down
24 changes: 24 additions & 0 deletions docs/book/beyond_basics/boilerplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% panel style="info", title="Under Development" %}
This book is being actively developed.
{% endpanel %}

# Defining Boilerplate License Headers

{% method %}

It is possible to add boilerplate license headers to all generated code by
modifying `hack/boilerplate.go.txt`.

If you don't create `boilerplate.go.txt` an empty version will be created for you by
`kubebuilder init`. Modifying this file will only impact files created afterward.

{% sample lang="bash" %}

```bash
mkdir hack
echo "// MY LICENSE" > hack/boilerplate.go.txt
kubebuilder init --domain k8s.io
```

{% endmethod %}

3 changes: 3 additions & 0 deletions docs/book/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export PATH=$PATH:/usr/local/kubebuilder/bin

Initialize the project directory with the canonical project structure and go dependencies.

**Note:** To add a boilerplate header to generated files, create `hack/boilerplate.go.txt`
and add your boilerplate before running `kubebuilder init`.

{% sample lang="bash" %}
```bash
kubebuilder init --domain k8s.io
Expand Down

0 comments on commit 5ba5473

Please sign in to comment.