Merge pull request #110779 from jbartosik/extend-e2e-framework-helpers
Add parameter to set SecurityContext for containers in tests
This commit is contained in:
@@ -183,8 +183,11 @@ type RCConfig struct {
|
||||
|
||||
ServiceAccountTokenProjections int
|
||||
|
||||
//Additional containers to run in the pod
|
||||
// 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,
|
||||
|
Reference in New Issue
Block a user