Skip to content

Commit 9dc0030

Browse files
authored
Merge pull request #5112 from guettli/add-note-about-editing-sample-first
📖 Quickstart: Add note about editing the resource
2 parents 18bc577 + fbb885a commit 9dc0030

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

docs/book/src/quick-start.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,35 @@ make run
183183

184184
## Install Instances of Custom Resources
185185

186-
If you pressed `y` for Create Resource [y/n] then you created a CR for your CRD in your samples (make sure to edit them first if you've changed the
187-
API definition):
186+
If you pressed `y` for Create Resource [y/n] then you created a CR for your CRD in your
187+
`config/samples/` directory.
188+
189+
Edit `config/samples/webapp_v1_guestbook.yaml` to contain a valid `spec`. For example:
190+
191+
```yaml
192+
# ...
193+
spec:
194+
foo: bar
195+
```
196+
197+
Hint: "foo" is a string field defined in `api/v1/guestbook_types.go`:
198+
199+
```go
200+
// foo is an example field of Guestbook. Edit guestbook_types.go to remove/update
201+
// +optional
202+
Foo *string `json:"foo,omitempty"`
203+
```
188204

189205
```bash
190206
kubectl apply -k config/samples/
191207
```
192208

209+
You can have a look at your applied resource now:
210+
211+
```bash
212+
kubectl get guestbooks.webapp.my.domain guestbook-sample -o yaml
213+
```
214+
193215
## Run It On the Cluster
194216

195217
When your controller is ready to be packaged and tested in other clusters.
@@ -313,4 +335,4 @@ before designing your own API and project.
313335
[markers]: reference/markers.md
314336
[controller-gen]: https://sigs.k8s.io/controller-tools/cmd/controller-gen
315337
[scaffolding-markers]: reference/markers/scaffold.md
316-
[ai-gh-models]: https://docs.github.com/en/github-models/about-github-models
338+
[ai-gh-models]: https://docs.github.com/en/github-models/about-github-models

0 commit comments

Comments
 (0)