Skip to content

Commit 5ba5473

Browse files
authored
Merge pull request #162 from pwittrock/docs-gen
Add section on boilerplate to the docs.
2 parents e0be45e + ca0b5ef commit 5ba5473

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

docs/book/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
### Beyond the Basics
3030

3131
* Development Workflow
32+
* [Defining Boilerplate License Headers](beyond_basics/boilerplate.md)
3233
* [Running Tests](beyond_basics/running_tests.md)
3334
* [Generating API Documentation](beyond_basics/generating_documentation.md)
3435
* [Updating Kubebuilder](beyond_basics/upgrading_kubebuilder.md)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% panel style="info", title="Under Development" %}
2+
This book is being actively developed.
3+
{% endpanel %}
4+
5+
# Defining Boilerplate License Headers
6+
7+
{% method %}
8+
9+
It is possible to add boilerplate license headers to all generated code by
10+
modifying `hack/boilerplate.go.txt`.
11+
12+
If you don't create `boilerplate.go.txt` an empty version will be created for you by
13+
`kubebuilder init`. Modifying this file will only impact files created afterward.
14+
15+
{% sample lang="bash" %}
16+
17+
```bash
18+
mkdir hack
19+
echo "// MY LICENSE" > hack/boilerplate.go.txt
20+
kubebuilder init --domain k8s.io
21+
```
22+
23+
{% endmethod %}
24+

docs/book/quick_start.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ export PATH=$PATH:/usr/local/kubebuilder/bin
3737

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

40+
**Note:** To add a boilerplate header to generated files, create `hack/boilerplate.go.txt`
41+
and add your boilerplate before running `kubebuilder init`.
42+
4043
{% sample lang="bash" %}
4144
```bash
4245
kubebuilder init --domain k8s.io

0 commit comments

Comments
 (0)