Skip to content

Commit

Permalink
Defining ENILimitedMemoryOverhead for Custom AMIFamily
Browse files Browse the repository at this point in the history
  • Loading branch information
suket22 committed Jul 21, 2022
1 parent 5cf4f70 commit bf9ac27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pkg/cloudprovider/aws/amifamily/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions pkg/cloudprovider/aws/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit bf9ac27

Please sign in to comment.