@@ -120,8 +120,6 @@ type SpecOption func(spec *corev1.PodSpec)
120
120
121
121
// NFDMaster provide NFD master pod definition
122
122
func NFDMaster (opts ... SpecOption ) * corev1.Pod {
123
- yes := true
124
- no := false
125
123
p := & corev1.Pod {
126
124
ObjectMeta : metav1.ObjectMeta {
127
125
GenerateName : "nfd-master-" ,
@@ -147,10 +145,10 @@ func NFDMaster(opts ...SpecOption) *corev1.Pod {
147
145
Capabilities : & corev1.Capabilities {
148
146
Drop : []corev1.Capability {"ALL" },
149
147
},
150
- Privileged : & no ,
151
- RunAsNonRoot : & yes ,
152
- ReadOnlyRootFilesystem : & yes ,
153
- AllowPrivilegeEscalation : & no ,
148
+ Privileged : ptr. To [ bool ]( false ) ,
149
+ RunAsNonRoot : ptr. To [ bool ]( true ) ,
150
+ ReadOnlyRootFilesystem : ptr. To [ bool ]( true ) ,
151
+ AllowPrivilegeEscalation : ptr. To [ bool ]( false ) ,
154
152
SeccompProfile : & corev1.SeccompProfile {
155
153
Type : corev1 .SeccompProfileTypeRuntimeDefault ,
156
154
},
@@ -252,8 +250,6 @@ func SpecWithConfigMap(name, mountPath string) SpecOption {
252
250
}
253
251
254
252
func nfdWorkerSpec (opts ... SpecOption ) * corev1.PodSpec {
255
- yes := true
256
- no := false
257
253
p := & corev1.PodSpec {
258
254
Containers : []corev1.Container {
259
255
{
@@ -291,10 +287,10 @@ func nfdWorkerSpec(opts ...SpecOption) *corev1.PodSpec {
291
287
Capabilities : & corev1.Capabilities {
292
288
Drop : []corev1.Capability {"ALL" },
293
289
},
294
- Privileged : & no ,
295
- RunAsNonRoot : & yes ,
296
- ReadOnlyRootFilesystem : & yes ,
297
- AllowPrivilegeEscalation : & no ,
290
+ Privileged : ptr. To [ bool ]( false ) ,
291
+ RunAsNonRoot : ptr. To [ bool ]( true ) ,
292
+ ReadOnlyRootFilesystem : ptr. To [ bool ]( true ) ,
293
+ AllowPrivilegeEscalation : ptr. To [ bool ]( false ) ,
298
294
SeccompProfile : & corev1.SeccompProfile {
299
295
Type : corev1 .SeccompProfileTypeRuntimeDefault ,
300
296
},
@@ -372,8 +368,6 @@ func nfdWorkerSpec(opts ...SpecOption) *corev1.PodSpec {
372
368
}
373
369
374
370
func NFDGCSpec (opts ... SpecOption ) * corev1.PodSpec {
375
- yes := true
376
- no := false
377
371
p := & corev1.PodSpec {
378
372
Containers : []corev1.Container {
379
373
{
@@ -384,10 +378,10 @@ func NFDGCSpec(opts ...SpecOption) *corev1.PodSpec {
384
378
Capabilities : & corev1.Capabilities {
385
379
Drop : []corev1.Capability {"ALL" },
386
380
},
387
- Privileged : & no ,
388
- RunAsNonRoot : & yes ,
389
- ReadOnlyRootFilesystem : & yes ,
390
- AllowPrivilegeEscalation : & no ,
381
+ Privileged : ptr. To [ bool ]( false ) ,
382
+ RunAsNonRoot : ptr. To [ bool ]( true ) ,
383
+ ReadOnlyRootFilesystem : ptr. To [ bool ]( true ) ,
384
+ AllowPrivilegeEscalation : ptr. To [ bool ]( false ) ,
391
385
SeccompProfile : & corev1.SeccompProfile {
392
386
Type : corev1 .SeccompProfileTypeRuntimeDefault ,
393
387
},
0 commit comments