mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 11:38:15 +00:00
Merge pull request #110779 from jbartosik/extend-e2e-framework-helpers
Add parameter to set SecurityContext for containers in tests
This commit is contained in:
commit
f0417ac850
@ -183,8 +183,11 @@ type RCConfig struct {
|
|||||||
|
|
||||||
ServiceAccountTokenProjections int
|
ServiceAccountTokenProjections int
|
||||||
|
|
||||||
//Additional containers to run in the pod
|
// Additional containers to run in the pod
|
||||||
AdditionalContainers []v1.Container
|
AdditionalContainers []v1.Container
|
||||||
|
|
||||||
|
// Security context for created pods
|
||||||
|
SecurityContext *v1.SecurityContext
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rc *RCConfig) RCConfigLog(fmt string, args ...interface{}) {
|
func (rc *RCConfig) RCConfigLog(fmt string, args ...interface{}) {
|
||||||
@ -340,6 +343,7 @@ func (config *DeploymentConfig) create() error {
|
|||||||
Command: config.Command,
|
Command: config.Command,
|
||||||
Ports: []v1.ContainerPort{{ContainerPort: 80}},
|
Ports: []v1.ContainerPort{{ContainerPort: 80}},
|
||||||
Lifecycle: config.Lifecycle,
|
Lifecycle: config.Lifecycle,
|
||||||
|
SecurityContext: config.SecurityContext,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -426,6 +430,7 @@ func (config *ReplicaSetConfig) create() error {
|
|||||||
Command: config.Command,
|
Command: config.Command,
|
||||||
Ports: []v1.ContainerPort{{ContainerPort: 80}},
|
Ports: []v1.ContainerPort{{ContainerPort: 80}},
|
||||||
Lifecycle: config.Lifecycle,
|
Lifecycle: config.Lifecycle,
|
||||||
|
SecurityContext: config.SecurityContext,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -503,6 +508,7 @@ func (config *JobConfig) create() error {
|
|||||||
Image: config.Image,
|
Image: config.Image,
|
||||||
Command: config.Command,
|
Command: config.Command,
|
||||||
Lifecycle: config.Lifecycle,
|
Lifecycle: config.Lifecycle,
|
||||||
|
SecurityContext: config.SecurityContext,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RestartPolicy: v1.RestartPolicyOnFailure,
|
RestartPolicy: v1.RestartPolicyOnFailure,
|
||||||
@ -618,6 +624,7 @@ func (config *RCConfig) create() error {
|
|||||||
Ports: []v1.ContainerPort{{ContainerPort: 80}},
|
Ports: []v1.ContainerPort{{ContainerPort: 80}},
|
||||||
ReadinessProbe: config.ReadinessProbe,
|
ReadinessProbe: config.ReadinessProbe,
|
||||||
Lifecycle: config.Lifecycle,
|
Lifecycle: config.Lifecycle,
|
||||||
|
SecurityContext: config.SecurityContext,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
DNSPolicy: *config.DNSPolicy,
|
DNSPolicy: *config.DNSPolicy,
|
||||||
|
Loading…
Reference in New Issue
Block a user