From bf9ac270e41a9218c460ec53803118a114bddf86 Mon Sep 17 00:00:00 2001 From: Suket Sharma Date: Thu, 21 Jul 2022 11:33:54 -0700 Subject: [PATCH] Defining ENILimitedMemoryOverhead for Custom AMIFamily --- pkg/cloudprovider/aws/amifamily/custom.go | 4 ++++ pkg/cloudprovider/aws/suite_test.go | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/cloudprovider/aws/amifamily/custom.go b/pkg/cloudprovider/aws/amifamily/custom.go index 4d01636f1bdd..7e7ba8e9a0d1 100644 --- a/pkg/cloudprovider/aws/amifamily/custom.go +++ b/pkg/cloudprovider/aws/amifamily/custom.go @@ -56,3 +56,7 @@ func (c Custom) EphemeralBlockDevice() *string { func (c Custom) EphemeralBlockDeviceOverhead() resource.Quantity { return resource.MustParse("5Gi") } + +func (c Custom) ENILimitedMemoryOverhead() bool { + return true +} diff --git a/pkg/cloudprovider/aws/suite_test.go b/pkg/cloudprovider/aws/suite_test.go index 6ae67a540c10..675054380d20 100644 --- a/pkg/cloudprovider/aws/suite_test.go +++ b/pkg/cloudprovider/aws/suite_test.go @@ -1556,7 +1556,7 @@ var _ = Describe("Allocation", func() { It("should not default block device mappings for custom AMIFamilies", func() { provider, _ := v1alpha1.Deserialize(provisioner.Spec.Provider) provider.AMIFamily = &v1alpha1.AMIFamilyCustom - ExpectApplied(ctx, env.Client, Provisioner(test.ProvisionerOptions{Provider: provider})) + ExpectApplied(ctx, env.Client, test.Provisioner(test.ProvisionerOptions{Provider: provider})) pod := ExpectProvisioned(ctx, env.Client, controller, test.UnschedulablePod())[0] ExpectScheduled(ctx, env.Client, pod) Expect(fakeEC2API.CalledWithCreateLaunchTemplateInput.Len()).To(Equal(1)) @@ -1579,7 +1579,7 @@ var _ = Describe("Allocation", func() { }, }, } - ExpectApplied(ctx, env.Client, Provisioner(test.ProvisionerOptions{Provider: provider})) + ExpectApplied(ctx, env.Client, test.Provisioner(test.ProvisionerOptions{Provider: provider})) pod := ExpectProvisioned(ctx, env.Client, controller, test.UnschedulablePod())[0] ExpectScheduled(ctx, env.Client, pod) Expect(fakeEC2API.CalledWithCreateLaunchTemplateInput.Len()).To(Equal(1)) @@ -1722,7 +1722,7 @@ var _ = Describe("Allocation", func() { }, }, } - ExpectApplied(ctx, env.Client, Provisioner(test.ProvisionerOptions{Provider: provider})) + ExpectApplied(ctx, env.Client, test.Provisioner(test.ProvisionerOptions{Provider: provider})) pod := ExpectProvisioned(ctx, env.Client, controller, test.UnschedulablePod(test.PodOptions{ResourceRequirements: v1.ResourceRequirements{ Requests: map[v1.ResourceName]resource.Quantity{