Skip to content

Commit

Permalink
e2e: don't set memory limit on initContainer
Browse files Browse the repository at this point in the history
There's a bug in AKS CoCo, where the init container's memory limit is
applied to the main container.
  • Loading branch information
burgerdev committed Apr 10, 2024
1 parent 5119c52 commit 4ec55ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 4ec55ad

Please sign in to comment.