You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/docs/contributing/operator.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,3 +86,21 @@ To run multiple operator instances locally (e.g. SCB operator and SCB Autodiscov
86
86
go run ./main.go -metrics-bind-address :9090 -health-probe-bind-address :9595
87
87
```
88
88
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.
0 commit comments