Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 47070e3

Browse files
committed
Comment all exported functions
1 parent d0cedc9 commit 47070e3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

operator/controllers/execution/scan_controller.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (r *ScanReconciler) startScan(scan *executionv1.Scan) error {
179179
Verbs: []string{"get"},
180180
},
181181
}
182-
r.EnsureServiceAccountExists(
182+
r.ensureServiceAccountExists(
183183
scan.Namespace,
184184
"lurcher",
185185
"Lurcher is used to extract results from secureCodeBox Scans. It needs rights to get and watch the status of pods to see when the scans have finished.",
@@ -277,7 +277,7 @@ func (r *ScanReconciler) startParser(scan *executionv1.Scan) error {
277277
Verbs: []string{"get", "patch"},
278278
},
279279
}
280-
r.EnsureServiceAccountExists(
280+
r.ensureServiceAccountExists(
281281
scan.Namespace,
282282
"parser",
283283
"Parser need to access the status of Scans to update how many findings have been identified",
@@ -533,7 +533,7 @@ func (r *ScanReconciler) startPersistenceProvider(scan *executionv1.Scan) error
533533
Verbs: []string{"get"},
534534
},
535535
}
536-
r.EnsureServiceAccountExists(
536+
r.ensureServiceAccountExists(
537537
scan.Namespace,
538538
"persistence",
539539
"PersistenceProvider need to access the current scan to view where its results are stored",
@@ -659,7 +659,7 @@ func (r *ScanReconciler) checkIfPersistingIsCompleted(scan *executionv1.Scan) er
659659
return nil
660660
}
661661

662-
func (r *ScanReconciler) EnsureServiceAccountExists(namespace, serviceAccountName, description string, policyRules []rbacv1.PolicyRule) error {
662+
func (r *ScanReconciler) ensureServiceAccountExists(namespace, serviceAccountName, description string, policyRules []rbacv1.PolicyRule) error {
663663
ctx := context.Background()
664664

665665
var serviceAccount corev1.ServiceAccount
@@ -746,6 +746,7 @@ func (r *ScanReconciler) EnsureServiceAccountExists(namespace, serviceAccountNam
746746
return nil
747747
}
748748

749+
// SetupWithManager sets up the controller and initializes every thing it needs
749750
func (r *ScanReconciler) SetupWithManager(mgr ctrl.Manager) error {
750751
endpoint := os.Getenv("S3_ENDPOINT")
751752
accessKeyID := os.Getenv("S3_ACCESS_KEY")

operator/controllers/execution/scheduledscan_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type ScheduledScanReconciler struct {
4040
// +kubebuilder:rbac:groups=execution.experimental.securecodebox.io,resources=scheduledscans,verbs=get;list;watch;create;update;patch;delete
4141
// +kubebuilder:rbac:groups=execution.experimental.securecodebox.io,resources=scheduledscans/status,verbs=get;update;patch
4242

43+
// Reconcile comapares the ScheduledScan Resource with the State of the Cluster and updates both accordingly
4344
func (r *ScheduledScanReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
4445
ctx := context.Background()
4546
log := r.Log.WithValues("scheduledscan", req.NamespacedName)
@@ -106,6 +107,7 @@ func (r *ScheduledScanReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro
106107
return ctrl.Result{RequeueAfter: nextSchedule.Sub(time.Now())}, nil
107108
}
108109

110+
// SetupWithManager sets up the controller and initializes every thing it needs
109111
func (r *ScheduledScanReconciler) SetupWithManager(mgr ctrl.Manager) error {
110112
if err := mgr.GetFieldIndexer().IndexField(&executionv1.Scan{}, ownerKey, func(rawObj runtime.Object) []string {
111113
// grab the job object, extract the owner...

0 commit comments

Comments
 (0)