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

Commit f5085c6

Browse files
committed
Remove redundant type definition and typos
1 parent ddde9b3 commit f5085c6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

operator/controllers/execution/scan_controller.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (r *ScanReconciler) startScan(scan *executionv1.Scan) error {
185185
log.Info("Matching ScanType Found", "ScanType", scanType.Name)
186186

187187
rules := []rbacv1.PolicyRule{
188-
rbacv1.PolicyRule{
188+
{
189189
APIGroups: []string{""},
190190
Resources: []string{"pods"},
191191
Verbs: []string{"get"},
@@ -248,7 +248,7 @@ func (r *ScanReconciler) checkIfScanIsCompleted(scan *executionv1.Scan) error {
248248
return err
249249
}
250250
}
251-
// Either Incomplete or Unkown, nothing we can do, other then giving it some more time...
251+
// Either Incomplete or Unknown, nothing we can do, other then giving it some more time...
252252
return nil
253253
}
254254

@@ -296,7 +296,7 @@ func (r *ScanReconciler) startParser(scan *executionv1.Scan) error {
296296
}
297297

298298
rules := []rbacv1.PolicyRule{
299-
rbacv1.PolicyRule{
299+
{
300300
APIGroups: []string{"execution.experimental.securecodebox.io"},
301301
Resources: []string{"scans/status"},
302302
Verbs: []string{"get", "patch"},
@@ -474,7 +474,7 @@ func (r *ScanReconciler) constructJobForScan(scan *executionv1.Scan, scanType *e
474474
case "":
475475
lurcherPullPolicy = corev1.PullAlways
476476
default:
477-
return nil, fmt.Errorf("Unkown imagePull Policy for lurcher: %s", lurcherPullPolicyRaw)
477+
return nil, fmt.Errorf("Unknown imagePull Policy for lurcher: %s", lurcherPullPolicyRaw)
478478
}
479479

480480
lurcherSidecar := &corev1.Container{
@@ -490,7 +490,7 @@ func (r *ScanReconciler) constructJobForScan(scan *executionv1.Scan, scanType *e
490490
resultUploadURL.String(),
491491
},
492492
Env: []corev1.EnvVar{
493-
corev1.EnvVar{
493+
{
494494
Name: "NAMESPACE",
495495
ValueFrom: &corev1.EnvVarSource{
496496
FieldRef: &corev1.ObjectFieldSelector{
@@ -513,7 +513,7 @@ func (r *ScanReconciler) constructJobForScan(scan *executionv1.Scan, scanType *e
513513
// },
514514
// },
515515
VolumeMounts: []corev1.VolumeMount{
516-
corev1.VolumeMount{
516+
{
517517
Name: "scan-results",
518518
MountPath: "/home/securecodebox/",
519519
},
@@ -572,7 +572,7 @@ func (r *ScanReconciler) startPersistenceProvider(scan *executionv1.Scan) error
572572
}
573573

574574
rules := []rbacv1.PolicyRule{
575-
rbacv1.PolicyRule{
575+
{
576576
APIGroups: []string{"execution.experimental.securecodebox.io"},
577577
Resources: []string{"scans"},
578578
Verbs: []string{"get"},
@@ -596,15 +596,15 @@ func (r *ScanReconciler) startPersistenceProvider(scan *executionv1.Scan) error
596596
}
597597

598598
standardEnvVars := []corev1.EnvVar{
599-
corev1.EnvVar{
599+
{
600600
Name: "NAMESPACE",
601601
ValueFrom: &corev1.EnvVarSource{
602602
FieldRef: &corev1.ObjectFieldSelector{
603603
FieldPath: "metadata.namespace",
604604
},
605605
},
606606
},
607-
corev1.EnvVar{
607+
{
608608
Name: "SCAN_NAME",
609609
Value: scan.Name,
610610
},
@@ -713,7 +713,7 @@ func (r *ScanReconciler) checkIfPersistingIsCompleted(scan *executionv1.Scan) er
713713
} else if persistenceCompletion == failed {
714714
r.Log.Info("At least one PersistenceProvider failed")
715715
scan.Status.State = "Errored"
716-
scan.Status.ErrorDescription = "At least one PersistenceProvider failed, check the persistence kubernets jobs related to the scan for more details."
716+
scan.Status.ErrorDescription = "At least one PersistenceProvider failed, check the persistence kubernetes jobs related to the scan for more details."
717717
if err := r.Status().Update(ctx, scan); err != nil {
718718
r.Log.Error(err, "unable to update Scan status")
719719
return err
@@ -788,7 +788,7 @@ func (r *ScanReconciler) ensureServiceAccountExists(namespace, serviceAccountNam
788788
},
789789
},
790790
Subjects: []rbacv1.Subject{
791-
rbacv1.Subject{
791+
{
792792
Kind: "ServiceAccount",
793793
Name: serviceAccountName,
794794
},

0 commit comments

Comments
 (0)