Skip to content

Commit 1a24cfc

Browse files
authored
Merge pull request #104 from fanminshi/add_layout
doc: add description for generated layout
2 parents 09d7ff9 + 0357c7b commit 1a24cfc

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

doc/project_layout.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Project Scaffolding Layout
22

3+
After creating a new operator project using
4+
`operator-sdk new`, the project directory has numerous generated folders and files. The following table describes a basic rundown of each generated file/directory.
5+
6+
37
| File/Folders | Purpose |
4-
| -------------- | --------------------------------- |
5-
| cmd | main.go |
6-
| config | config |
8+
| :--- | :--- |
9+
| Gopkg.toml Gopkg.lock | The [Go Dep][dep] manifests that describe the external dependencies of this operator. |
10+
| cmd | Contains `main.go` which is the entry point to initialize and start this operator using the operator-sdk APIs. |
11+
| config | Contains metadata about state of this project such as project name, kind, api-version, and so forth. The operator-sdk commands use this metadata to perform actions that require knowing the state. |
12+
| deploy | Contains a generic set of kubernetes manifests for deploying this operator on a kubernetes cluster. |
13+
| pkg/apis | Contains the directory tree that defines the APIs and types of Custom Resource Definitions(CRD). These files allow the sdk to do code generation for CRD types and register the schemes for all types in order to correctly decode Custom Resource objects. |
14+
| pkg/stub | Contains `handler.go` which is the place for a user to write all the operating business logic. |
15+
| tmp | Contains scripts that the operator-sdk uses for build and code generation. |
16+
| vendor | The golang [vendor][Vendor] folder that contains the local copies of the external dependencies that satisfy the imports of this project. [Go Dep][dep] manages the vendor directly. |
17+
18+
[Vendor]: https://golang.org/cmd/go/#hdr-Vendor_Directories
19+
[dep]: https://github.com/golang/dep

0 commit comments

Comments
 (0)