mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 19:47:56 +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
@ -185,6 +185,9 @@ type RCConfig struct {
|
||||
|
||||
// Additional containers to run in the pod
|
||||
AdditionalContainers []v1.Container
|
||||
|
||||
// Security context for created pods
|
||||
SecurityContext *v1.SecurityContext
|
||||
}
|
||||
|
||||
func (rc *RCConfig) RCConfigLog(fmt string, args ...interface{}) {
|
||||
@ -340,6 +343,7 @@ func (config *DeploymentConfig) create() error {
|
||||
Command: config.Command,
|
||||
Ports: []v1.ContainerPort{{ContainerPort: 80}},
|
||||
Lifecycle: config.Lifecycle,
|
||||
SecurityContext: config.SecurityContext,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -426,6 +430,7 @@ func (config *ReplicaSetConfig) create() error {
|
||||
Command: config.Command,
|
||||
Ports: []v1.ContainerPort{{ContainerPort: 80}},
|
||||
Lifecycle: config.Lifecycle,
|
||||
SecurityContext: config.SecurityContext,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -503,6 +508,7 @@ func (config *JobConfig) create() error {
|
||||
Image: config.Image,
|
||||
Command: config.Command,
|
||||
Lifecycle: config.Lifecycle,
|
||||
SecurityContext: config.SecurityContext,
|
||||
},
|
||||
},
|
||||
RestartPolicy: v1.RestartPolicyOnFailure,
|
||||
@ -618,6 +624,7 @@ func (config *RCConfig) create() error {
|
||||
Ports: []v1.ContainerPort{{ContainerPort: 80}},
|
||||
ReadinessProbe: config.ReadinessProbe,
|
||||
Lifecycle: config.Lifecycle,
|
||||
SecurityContext: config.SecurityContext,
|
||||
},
|
||||
},
|
||||
DNSPolicy: *config.DNSPolicy,
|
||||
|
Loading…
Reference in New Issue
Block a user