Add tests for hugepages not being set on container if not requested in custom resource
This commit is contained in:
parent
1bdc7c7f03
commit
3e7ffa1edc
|
|
@ -2978,6 +2978,39 @@ func TestGenerateResourceRequirements(t *testing.T) {
|
||||||
ResourceLimits: acidv1.ResourceDescription{CPU: "1", Memory: "2Gi"},
|
ResourceLimits: acidv1.ResourceDescription{CPU: "1", Memory: "2Gi"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
subTest: "test HugePages are not set on container when not requested in manifest",
|
||||||
|
config: config.Config{
|
||||||
|
Resources: configResources,
|
||||||
|
PodManagementPolicy: "ordered_ready",
|
||||||
|
},
|
||||||
|
pgSpec: acidv1.Postgresql{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: clusterName,
|
||||||
|
Namespace: namespace,
|
||||||
|
},
|
||||||
|
Spec: acidv1.PostgresSpec{
|
||||||
|
Resources: &acidv1.Resources{
|
||||||
|
ResourceRequests: acidv1.ResourceDescription{},
|
||||||
|
ResourceLimits: acidv1.ResourceDescription{},
|
||||||
|
},
|
||||||
|
TeamID: "acid",
|
||||||
|
Volume: acidv1.Volume{
|
||||||
|
Size: "1G",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expectedResources: acidv1.Resources{
|
||||||
|
ResourceRequests: acidv1.ResourceDescription{
|
||||||
|
CPU: "100m",
|
||||||
|
Memory: "100Mi",
|
||||||
|
},
|
||||||
|
ResourceLimits: acidv1.ResourceDescription{
|
||||||
|
CPU: "1",
|
||||||
|
Memory: "500Mi",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
subTest: "test HugePages are passed through to the postgres container",
|
subTest: "test HugePages are passed through to the postgres container",
|
||||||
config: config.Config{
|
config: config.Config{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue