Skip to content

Commit 0bf49cd

Browse files
committed
#302 Added notes to operator documentation
Signed-off-by: Samreet Singh <samreet.singh@iteratec.com>
1 parent 2a80c31 commit 0bf49cd

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

documentation/docs/contributing/operator.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,21 @@ To run multiple operator instances locally (e.g. SCB operator and SCB Autodiscov
8686
go run ./main.go -metrics-bind-address :9090 -health-probe-bind-address :9595
8787
```
8888

89+
## Structure
90+
91+
The operator was build based on the [kubebuilder](https://book.kubebuilder.io/cronjob-tutorial/cronjob-tutorial). Here is a very short summery on the important files. For a better understanding you should read the [kubebuilder](https://book.kubebuilder.io/cronjob-tutorial/cronjob-tutorial)
92+
93+
API and Controller Files:
94+
95+
`apis/`
96+
97+
The files defines the APIs for the custom resources (CRDs) e.g. the file `scan_types.go` defines the schema (Spec, Status etc.) for the CRD _Scan_. The fields and definitions are changed here. To update the the CRDs in the operator run `make install` in the /operator directory.
98+
99+
100+
`controllers/`
101+
102+
Contains the controllers that manage the CRDs e.g. `scantype_controller.go` implements how scans are started, updated and terminated.
103+
104+
Reconcile Function:
105+
The reconcile function is a loop that checks the current state of the resource and updates them according to their state.
106+

0 commit comments

Comments
 (0)