Skip to content

Commit

Permalink
Deregister test AMIs after test is run
Browse files Browse the repository at this point in the history
- This test was added recently and we discovered it was leaking the test AMI
- Also fix a test input validation typo

Signed-off-by: Joseph Palermo <[email protected]>
Co-authored-by: Joseph Palermo <[email protected]>
  • Loading branch information
klakin-pivotal and jpalermo committed Mar 28, 2024
1 parent 5e4f86d commit b738246
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions driver/create_ami_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ var _ = Describe("CreateAmiDriver", func() {
})
Expect(err).ToNot(HaveOccurred())
Expect(*output.LaunchPermissions[0].UserId).To(Equal(awsAccount))

_, err = ec2Client.DeregisterImage(&ec2.DeregisterImageInput{ImageId: &ami.ID})
Expect(err).ToNot(HaveOccurred())
})
})
})
2 changes: 1 addition & 1 deletion driver/driver_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var _ = SynchronizedBeforeSuite(
Expect(machineImagePath).ToNot(BeEmpty(), "MACHINE_IMAGE_PATH must be set")

machineImageFormat = os.Getenv("MACHINE_IMAGE_FORMAT")
Expect(machineImagePath).ToNot(BeEmpty(), "MACHINE_IMAGE_FORMAT must be set")
Expect(machineImageFormat).ToNot(BeEmpty(), "MACHINE_IMAGE_FORMAT must be set")

// S3 Machine Image info
s3MachineImageUrl = os.Getenv("S3_MACHINE_IMAGE_URL")
Expand Down

0 comments on commit b738246

Please sign in to comment.