@@ -24,6 +24,61 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
24
24
if err != nil {
25
25
return nil , err
26
26
}
27
+ volumeMounts := []corev1.VolumeMount {
28
+ {
29
+ Name : "config" ,
30
+ MountPath : "/config" ,
31
+ },
32
+ {
33
+ Name : "wsman-tls-certs" ,
34
+ MountPath : "/wsman-certs" ,
35
+ ReadOnly : true ,
36
+ },
37
+ common .CAVolumeMount (),
38
+ }
39
+
40
+ filesystemScanningEnabled := ctx .Config .Components != nil &&
41
+ ctx .Config .Components .AgentSmith != nil &&
42
+ ctx .Config .Components .AgentSmith .FilesystemScanning != nil &&
43
+ ctx .Config .Components .AgentSmith .FilesystemScanning .Enabled
44
+
45
+ if filesystemScanningEnabled {
46
+ volumeMounts = append (volumeMounts , corev1.VolumeMount {
47
+ Name : "working-area" ,
48
+ MountPath : ContainerWorkingAreaMk2 ,
49
+ ReadOnly : true ,
50
+ })
51
+ }
52
+
53
+ volumes := []corev1.Volume {
54
+ {
55
+ Name : "config" ,
56
+ VolumeSource : corev1.VolumeSource {ConfigMap : & corev1.ConfigMapVolumeSource {
57
+ LocalObjectReference : corev1.LocalObjectReference {Name : Component },
58
+ }},
59
+ },
60
+ {
61
+ Name : "wsman-tls-certs" ,
62
+ VolumeSource : corev1.VolumeSource {
63
+ Secret : & corev1.SecretVolumeSource {
64
+ SecretName : wsmanagermk2 .TLSSecretNameClient ,
65
+ },
66
+ },
67
+ },
68
+ common .CAVolume (),
69
+ }
70
+
71
+ if filesystemScanningEnabled {
72
+ volumes = append (volumes , corev1.Volume {
73
+ Name : "working-area" ,
74
+ VolumeSource : corev1.VolumeSource {
75
+ HostPath : & corev1.HostPathVolumeSource {
76
+ Path : HostWorkingAreaMk2 ,
77
+ Type : func () * corev1.HostPathType { t := corev1 .HostPathDirectory ; return & t }(),
78
+ },
79
+ },
80
+ })
81
+ }
27
82
28
83
return []runtime.Object {& appsv1.DaemonSet {
29
84
TypeMeta : common .TypeMetaDaemonset ,
@@ -64,23 +119,7 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
64
119
"memory" : resource .MustParse ("32Mi" ),
65
120
},
66
121
}),
67
- VolumeMounts : []corev1.VolumeMount {
68
- {
69
- Name : "config" ,
70
- MountPath : "/config" ,
71
- },
72
- {
73
- Name : "wsman-tls-certs" ,
74
- MountPath : "/wsman-certs" ,
75
- ReadOnly : true ,
76
- },
77
- {
78
- Name : "working-area" ,
79
- MountPath : ContainerWorkingAreaMk2 ,
80
- ReadOnly : true ,
81
- },
82
- common .CAVolumeMount (),
83
- },
122
+ VolumeMounts : volumeMounts ,
84
123
Env : common .CustomizeEnvvar (ctx , Component , common .MergeEnv (
85
124
common .DefaultEnv (& ctx .Config ),
86
125
common .WorkspaceTracingEnv (ctx , Component ),
@@ -93,32 +132,7 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
93
132
},
94
133
* common .KubeRBACProxyContainer (ctx ),
95
134
},
96
- Volumes : []corev1.Volume {
97
- {
98
- Name : "config" ,
99
- VolumeSource : corev1.VolumeSource {ConfigMap : & corev1.ConfigMapVolumeSource {
100
- LocalObjectReference : corev1.LocalObjectReference {Name : Component },
101
- }},
102
- },
103
- {
104
- Name : "wsman-tls-certs" ,
105
- VolumeSource : corev1.VolumeSource {
106
- Secret : & corev1.SecretVolumeSource {
107
- SecretName : wsmanagermk2 .TLSSecretNameClient ,
108
- },
109
- },
110
- },
111
- {
112
- Name : "working-area" ,
113
- VolumeSource : corev1.VolumeSource {
114
- HostPath : & corev1.HostPathVolumeSource {
115
- Path : HostWorkingAreaMk2 ,
116
- Type : func () * corev1.HostPathType { t := corev1 .HostPathDirectory ; return & t }(),
117
- },
118
- },
119
- },
120
- common .CAVolume (),
121
- },
135
+ Volumes : volumes ,
122
136
Tolerations : []corev1.Toleration {
123
137
{
124
138
Effect : corev1 .TaintEffectNoSchedule ,
0 commit comments