Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: don't set memory limit on initContainer #316

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/internal/kuberesource/parts.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func Initializer() *applycorev1.ContainerApplyConfiguration {
WithName("initializer").
WithImage("ghcr.io/edgelesssys/contrast/initializer:latest").
WithResources(ResourceRequirements().
WithMemoryLimitAndRequest(50),
WithMemoryRequest(50),
).
WithEnv(NewEnvVar("COORDINATOR_HOST", "coordinator")).
WithVolumeMounts(VolumeMount().
Expand Down
8 changes: 8 additions & 0 deletions e2e/internal/kuberesource/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ func ResourceRequirements() *ResourceRequirementsConfig {
return &ResourceRequirementsConfig{applycorev1.ResourceRequirements()}
}

// WithMemoryRequest sets the memory request of the ResourceRequirements.
func (r *ResourceRequirementsConfig) WithMemoryRequest(memoryMi int64) *applycorev1.ResourceRequirementsApplyConfiguration {
return r.
WithRequests(corev1.ResourceList{
corev1.ResourceMemory: fromPtr(resource.NewQuantity(memoryMi*1024*1024, resource.BinarySI)),
})
}

// WithMemoryLimitAndRequest sets the memory limit and request of the ResourceRequirements.
func (r *ResourceRequirementsConfig) WithMemoryLimitAndRequest(memoryMi int64) *applycorev1.ResourceRequirementsApplyConfiguration {
return r.
Expand Down
Loading