Skip to content

Commit

Permalink
non-initialized list fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
bartolini committed Sep 4, 2024
1 parent 3429820 commit d354bb3
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions pkg/render/intrusiondetection/dpi/dpi.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,24 @@ func (d *dpiComponent) dpiDaemonset() *appsv1.DaemonSet {
if d.cfg.TyphaNodeTLS.NodeSecret.UseCertificateManagement() {
initContainers = append(initContainers, d.cfg.TyphaNodeTLS.NodeSecret.InitContainer(DeepPacketInspectionNamespace))
}
for iter, snortInitContainer := range d.cfg.IntrusionDetection.Spec.DeepPacketInspectionDaemonset.SnortInitContainers {
container := corev1.Container{
Name: fmt.Sprintf("%s-%d", DeepPacketInspectionInitContainerName, iter),
Image: snortInitContainer.Image,
ImagePullPolicy: corev1.PullAlways,
VolumeMounts: []corev1.VolumeMount{
{
Name: DeepPacketInspectionSnortRulesVolumeName,
MountPath: DeepPacketInspectionSnortRulesVolumePath,
if d.cfg.IntrusionDetection.Spec.DeepPacketInspectionDaemonset.SnortInitContainers != nil {
for iter, snortInitContainer := range d.cfg.IntrusionDetection.Spec.DeepPacketInspectionDaemonset.SnortInitContainers {
container := corev1.Container{
Name: fmt.Sprintf("%s-%d", DeepPacketInspectionInitContainerName, iter),
Image: snortInitContainer.Image,
ImagePullPolicy: corev1.PullAlways,
VolumeMounts: []corev1.VolumeMount{
{
Name: DeepPacketInspectionSnortRulesVolumeName,
MountPath: DeepPacketInspectionSnortRulesVolumePath,
},
},
},
}
if snortInitContainer.Resources != nil {
container.Resources = *snortInitContainer.Resources
}
if snortInitContainer.Resources != nil {
container.Resources = *snortInitContainer.Resources
}
initContainers = append(initContainers, container)
}
initContainers = append(initContainers, container)
}

podTemplate := &corev1.PodTemplateSpec{
Expand Down

0 comments on commit d354bb3

Please sign in to comment.