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

Commit 3dfcc92

Browse files
authored
Merge pull request #117 from secureCodeBox/disable-istio-injection
Disable Istio Injection for Scan/Parser/Hook Pods
2 parents d59daec + d379001 commit 3dfcc92

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

operator/controllers/execution/scans/hook_reconciler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@ func (r *ScanReconciler) createJobForHook(hook *executionv1.ScanCompletionHook,
376376
Annotations: map[string]string{
377377
"auto-discovery.experimental.securecodebox.io/ignore": "true",
378378
},
379+
Labels: map[string]string{
380+
"sidecar.istio.io/inject": "false",
381+
},
379382
},
380383
Spec: corev1.PodSpec{
381384
ServiceAccountName: serviceAccountName,

operator/controllers/execution/scans/parse_reconciler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ func (r *ScanReconciler) startParser(scan *executionv1.Scan) error {
9494
Annotations: map[string]string{
9595
"auto-discovery.experimental.securecodebox.io/ignore": "true",
9696
},
97+
Labels: map[string]string{
98+
"sidecar.istio.io/inject": "false",
99+
},
97100
},
98101
Spec: corev1.PodSpec{
99102
RestartPolicy: corev1.RestartPolicyNever,

operator/controllers/execution/scans/scan_reconciler.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@ func (r *ScanReconciler) constructJobForScan(scan *executionv1.Scan, scanType *e
187187
},
188188
})
189189

190+
// Ensuring that istio doesn't inject a sidecar proxy.
191+
// This currently messes with
192+
if job.Spec.Template.ObjectMeta.Labels != nil {
193+
job.Spec.Template.ObjectMeta.Labels["sidecar.istio.io/inject"] = "true"
194+
} else {
195+
job.Spec.Template.ObjectMeta.Labels = map[string]string{
196+
"sidecar.istio.io/inject": "false",
197+
}
198+
}
199+
190200
// merging volume mounts (for the primary scanner container) from ScanType (if existing) with standard results volume mount
191201
if job.Spec.Template.Spec.Containers[0].VolumeMounts == nil || len(job.Spec.Template.Spec.Containers[0].VolumeMounts) == 0 {
192202
job.Spec.Template.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{}

0 commit comments

Comments
 (0)