mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
Merge pull request #1836 from marquiz/devel/e2e-ptr
test/e2e: use ptr.To to get pointer to bool
This commit is contained in:
commit
4dbe9c8951
1 changed files with 12 additions and 18 deletions
|
@ -120,8 +120,6 @@ type SpecOption func(spec *corev1.PodSpec)
|
||||||
|
|
||||||
// NFDMaster provide NFD master pod definition
|
// NFDMaster provide NFD master pod definition
|
||||||
func NFDMaster(opts ...SpecOption) *corev1.Pod {
|
func NFDMaster(opts ...SpecOption) *corev1.Pod {
|
||||||
yes := true
|
|
||||||
no := false
|
|
||||||
p := &corev1.Pod{
|
p := &corev1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
GenerateName: "nfd-master-",
|
GenerateName: "nfd-master-",
|
||||||
|
@ -147,10 +145,10 @@ func NFDMaster(opts ...SpecOption) *corev1.Pod {
|
||||||
Capabilities: &corev1.Capabilities{
|
Capabilities: &corev1.Capabilities{
|
||||||
Drop: []corev1.Capability{"ALL"},
|
Drop: []corev1.Capability{"ALL"},
|
||||||
},
|
},
|
||||||
Privileged: &no,
|
Privileged: ptr.To[bool](false),
|
||||||
RunAsNonRoot: &yes,
|
RunAsNonRoot: ptr.To[bool](true),
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: ptr.To[bool](true),
|
||||||
AllowPrivilegeEscalation: &no,
|
AllowPrivilegeEscalation: ptr.To[bool](false),
|
||||||
SeccompProfile: &corev1.SeccompProfile{
|
SeccompProfile: &corev1.SeccompProfile{
|
||||||
Type: corev1.SeccompProfileTypeRuntimeDefault,
|
Type: corev1.SeccompProfileTypeRuntimeDefault,
|
||||||
},
|
},
|
||||||
|
@ -252,8 +250,6 @@ func SpecWithConfigMap(name, mountPath string) SpecOption {
|
||||||
}
|
}
|
||||||
|
|
||||||
func nfdWorkerSpec(opts ...SpecOption) *corev1.PodSpec {
|
func nfdWorkerSpec(opts ...SpecOption) *corev1.PodSpec {
|
||||||
yes := true
|
|
||||||
no := false
|
|
||||||
p := &corev1.PodSpec{
|
p := &corev1.PodSpec{
|
||||||
Containers: []corev1.Container{
|
Containers: []corev1.Container{
|
||||||
{
|
{
|
||||||
|
@ -291,10 +287,10 @@ func nfdWorkerSpec(opts ...SpecOption) *corev1.PodSpec {
|
||||||
Capabilities: &corev1.Capabilities{
|
Capabilities: &corev1.Capabilities{
|
||||||
Drop: []corev1.Capability{"ALL"},
|
Drop: []corev1.Capability{"ALL"},
|
||||||
},
|
},
|
||||||
Privileged: &no,
|
Privileged: ptr.To[bool](false),
|
||||||
RunAsNonRoot: &yes,
|
RunAsNonRoot: ptr.To[bool](true),
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: ptr.To[bool](true),
|
||||||
AllowPrivilegeEscalation: &no,
|
AllowPrivilegeEscalation: ptr.To[bool](false),
|
||||||
SeccompProfile: &corev1.SeccompProfile{
|
SeccompProfile: &corev1.SeccompProfile{
|
||||||
Type: corev1.SeccompProfileTypeRuntimeDefault,
|
Type: corev1.SeccompProfileTypeRuntimeDefault,
|
||||||
},
|
},
|
||||||
|
@ -372,8 +368,6 @@ func nfdWorkerSpec(opts ...SpecOption) *corev1.PodSpec {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NFDGCSpec(opts ...SpecOption) *corev1.PodSpec {
|
func NFDGCSpec(opts ...SpecOption) *corev1.PodSpec {
|
||||||
yes := true
|
|
||||||
no := false
|
|
||||||
p := &corev1.PodSpec{
|
p := &corev1.PodSpec{
|
||||||
Containers: []corev1.Container{
|
Containers: []corev1.Container{
|
||||||
{
|
{
|
||||||
|
@ -384,10 +378,10 @@ func NFDGCSpec(opts ...SpecOption) *corev1.PodSpec {
|
||||||
Capabilities: &corev1.Capabilities{
|
Capabilities: &corev1.Capabilities{
|
||||||
Drop: []corev1.Capability{"ALL"},
|
Drop: []corev1.Capability{"ALL"},
|
||||||
},
|
},
|
||||||
Privileged: &no,
|
Privileged: ptr.To[bool](false),
|
||||||
RunAsNonRoot: &yes,
|
RunAsNonRoot: ptr.To[bool](true),
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: ptr.To[bool](true),
|
||||||
AllowPrivilegeEscalation: &no,
|
AllowPrivilegeEscalation: ptr.To[bool](false),
|
||||||
SeccompProfile: &corev1.SeccompProfile{
|
SeccompProfile: &corev1.SeccompProfile{
|
||||||
Type: corev1.SeccompProfileTypeRuntimeDefault,
|
Type: corev1.SeccompProfileTypeRuntimeDefault,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue